import AlertKonfirmasi from "@/components/alertKonfirmasi";
import ButtonBackHeader from "@/components/buttonBackHeader";
import { ButtonForm } from "@/components/buttonForm";
import ButtonSelect from "@/components/buttonSelect";
import { InputForm } from "@/components/inputForm";
import SelectForm from "@/components/selectForm";
import Styles from "@/constants/Styles";
import { router, Stack } from "expo-router";
import { useState } from "react";
import { SafeAreaView, ScrollView, ToastAndroid, View } from "react-native";

export default function CreateDiscussionGeneral() {
   const [chooseGroup, setChooseGroup] = useState({ val: '', label: '' })

   return (
      <SafeAreaView>
         <Stack.Screen
            options={{
               headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
               headerTitle: 'Tambah Diskusi',
               headerTitleAlign: 'center',
            }}
         />
         <ScrollView>
            <View style={[Styles.p15, Styles.mb100]}>
               <SelectForm label="Lembaga Desa" placeholder="Pilih Lembaga Desa" value={chooseGroup.label} required onPress={() => { }} />
               <InputForm label="Nama" type="default" placeholder="Nama" required />
               <InputForm label="Diskusi" type="default" placeholder="Hal yang didiskusikan" required />
               <ButtonSelect value="Pilih Anggota"/>
               <ButtonForm
                  text="SIMPAN"
                  onPress={() => {
                     AlertKonfirmasi({
                        title: 'Konfirmasi',
                        desc: 'Apakah anda yakin ingin menambahkan data?',
                        onPress: () => {
                           ToastAndroid.show('Berhasil menambahkan data', ToastAndroid.SHORT)
                           router.push('/discussion?active=true')
                        }
                     })
                  }} />
            </View>
         </ScrollView>
      </SafeAreaView>
   )
}