Deskripsi: - akan ditolak jika input nama divisi udah ada - alert konfirmasi custom 1 tombol No Issues
31 lines
601 B
TypeScript
31 lines
601 B
TypeScript
import { Alert } from "react-native";
|
|
|
|
|
|
type Props = {
|
|
title: string,
|
|
desc: string
|
|
onPress: () => void
|
|
category?: string
|
|
}
|
|
|
|
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() }
|
|
},
|
|
]);
|
|
}
|
|
} |