import Dialog from '@material-hu/components/design-system/Dialog';

import { useLokaliseTranslation } from 'src/utils/i18n';

export type CloseEvaluationDialogProps = {
  onClose: () => void;
  onConfirm: () => void;
};

export const CloseEvaluationDialog = ({
  onClose,
  onConfirm,
}: CloseEvaluationDialogProps) => {
  const { t } = useLokaliseTranslation(['learning', 'general']);

  return (
    <Dialog
      onClose={onClose}
      title={t('general:attention')}
      textBody={t('course.signature.close_description')}
      primaryButtonProps={{
        onClick: onConfirm,
        children: t('common.exit_anyway'),
      }}
      secondaryButtonProps={{
        onClick: onClose,
        children: t('course.signature.sign_now'),
      }}
    />
  );
};

export default CloseEvaluationDialog;
