//@ts-ignore
import { Alert } from 'react-native';

const AlertMessage = (message: string, title?: string, onPressOk?: any, cancel?: boolean) => {
    Alert.alert(
        title || '',
        message,
        cancel
            ? [
                  {
                      text:"Hien thi btn khong",
                      style: 'default',
                  },
                  {
                      text: 'Title btn co',
                      onPress: () => {
                          if (typeof onPressOk === 'function') {
                              onPressOk();
                          }
                      },
                      style: 'default',
                  },
              ]
            : [
                  {
                      text:"Hien thi thong bao khong co cancel",
                      onPress: () => {
                          if (typeof onPressOk === 'function') {
                              onPressOk();
                          }
                      },
                  },
              ],
        { cancelable: false },
    );
};
export default AlertMessage;
