upd: tolak nama divisi yg sama

Deskripsi:
- akan ditolak jika input nama divisi udah ada
- alert konfirmasi custom 1 tombol

No Issues
This commit is contained in:
2025-10-27 11:31:47 +08:00
parent fb8a140a31
commit 74ba2641ca
2 changed files with 24 additions and 15 deletions

View File

@@ -5,17 +5,27 @@ type Props = {
title: string,
desc: string
onPress: () => void
category?: string
}
export default function AlertKonfirmasi({ title, desc, onPress }: Props) {
Alert.alert(title, desc, [
{
text: 'Tidak',
style: 'cancel',
},
{
text: 'Ya',
onPress: () => { onPress() }
},
]);
export default function AlertKonfirmasi({ title, desc, onPress, category }: Props) {
if (category == "warning") {
Alert.alert(title, desc, [
{
text: 'Oke',
style: 'cancel',
},
]);
} else {
Alert.alert(title, desc, [
{
text: 'Tidak',
style: 'cancel',
},
{
text: 'Ya',
onPress: () => { onPress() }
},
]);
}
}