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 Styles from "@/constants/Styles"
import { router, Stack } from "expo-router"
import { SafeAreaView, ScrollView, ToastAndroid, View } from "react-native"

export default function EditAnnouncement() {
   return (
      <SafeAreaView>
         <Stack.Screen
            options={{
               headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
               headerTitle: 'Edit Pengumuman',
               headerTitleAlign: 'center',
            }}
         />
         <ScrollView>
            <View style={[Styles.p15, Styles.mb100]}>
               <InputForm label="Judul" type="default" placeholder="Judul Pengumuman" required />
               <InputForm label="Pengumuman" type="default" placeholder="Deskripsi Pengumuman" required />
               <ButtonSelect value="Pilih divisi penerima pengumuman" />
               <ButtonForm
                  text="SIMPAN"
                  onPress={() => {
                     AlertKonfirmasi({
                        title: 'Konfirmasi',
                        desc: 'Apakah anda yakin ingin mengubah data?',
                        onPress: () => {
                           ToastAndroid.show('Berhasil mengubah data', ToastAndroid.SHORT)
                           router.push('/announcement')
                        }
                     })
                  }} />
            </View>
         </ScrollView>
      </SafeAreaView>
   )
}