// Toast.js
import Toast from 'react-native-toast-message';
const showToast = (type, text1, text2) => {
  Toast.show({
    type: type,
    text1: text1,
    text2: text2,
    position: 'top',
    visibilityTime: 3000,
    autoHide: true,
    topOffset: 30,
    bottomOffset: 40,
    text1Style: {
        fontSize: 15, // Custom font size for the main text
        fontWeight: 'bold',
      },
      text2Style: {
        fontSize: 14, // Custom font size for the secondary text
        color:'gray'
      },
  });
};

const ToastComponent = () => {
  return <Toast innerRef={(ref) => Toast.setRef(ref)} />;
};

const toastSuccess = (text1, text2) => {
  showToast('success', text1, text2);
};

const toastError = (text1, text2) => {
  showToast('error', text1, text2);
};

export { ToastComponent, toastSuccess, toastError };