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

const AlertMessage = (message: string, title?: string, onPressOk?: any, cancel?: boolean) => {
    Alert.alert(
        title || '',
        message,
        cancel
            ? [
                   
                  {
                      text: 'Đồng ý',
                      onPress: () => {
                          if (typeof onPressOk === 'function') {
                              onPressOk();
                          }
                      },
                      style: 'default',
                  },
              ]
            : [
                  {
                      text:"Từ chối",
                      onPress: () => {
                          if (typeof onPressOk === 'function') {
                              onPressOk();
                          }
                      },
                  },
              ],
        { cancelable: false },
    );
};
export default AlertMessage;
