import { IonToast } from '@ionic/react';
import { WRONG_ANSWER_DISMISS_TIMEOUT, WRONG_ANSWER_MESSAGE } from '../../constants';

import './style.css';

interface QuestionCardProps {
  isOpen: boolean;
  dismiss: () => void;
}

const WrongAnswerToast: React.FC<QuestionCardProps> = ({ isOpen, dismiss }) => {
  return (
    <>
      <IonToast
        className='wrong-answer-toast'
        isOpen={isOpen}
        message={WRONG_ANSWER_MESSAGE}
        onDidDismiss={() => dismiss()}
        duration={WRONG_ANSWER_DISMISS_TIMEOUT}
        color='danger'
      ></IonToast>
    </>
  );
};

export default WrongAnswerToast;
