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() }
         },
      ]);
   }
}