import { Alert } from 'antd';

export const AlertMessage = ({ type, message }) => {
  let alertType;
  let alertMessage;

  switch (type) {
    case 'success':
      alertType = 'success';
      alertMessage = message || 'Success Text';
      break;
    case 'info':
      alertType = 'info';
      alertMessage = message || 'Info Text';
      break;
    case 'warning':
      alertType = 'warning';
      alertMessage = message || 'Warning Text';
      break;
    case 'error':
      alertType = 'error';
      alertMessage = message || 'Error Text';
      break;
    default:
      alertType = 'info';
      alertMessage = message || 'Default Info Text';
  }

  return <Alert message={alertMessage} className='capitalize' type={alertType} />;
};
