import { IonToast } from '@ionic/react';
import './style.css';
import { CORRECT_ANSWER_MESSAGE, CORRECT_ANSWER_DISMISS_TIMEOUT } from '../../constants';

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

const CorrectAnswerToast: React.FC<QuestionCardProps> = ({ isOpen, dismiss }) => {
  return (
    <>
      <IonToast
        className='correct-answer-toast'
        isOpen={isOpen}
        message={CORRECT_ANSWER_MESSAGE}
        onDidDismiss={() => dismiss()}
        duration={CORRECT_ANSWER_DISMISS_TIMEOUT}
        color='success'
      ></IonToast>
    </>
  );
};

export default CorrectAnswerToast;
