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

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

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

const CancelDuplicateArticleModal = ({
  onClose,
  onConfirm,
}: CancelDuplicateArticleModalProps) => {
  const { t } = useLokaliseTranslation('libraries');

  const handleConfirm = () => {
    onClose();
    onConfirm();
  };

  return (
    <Dialog
      onClose={onClose}
      title={t('article.duplicate.cancel.title')}
      textBody={t('article.duplicate.cancel.description')}
      secondaryButtonProps={{
        children: t('general:cancel'),
        onClick: onClose,
      }}
      primaryButtonProps={{
        children: t('article.duplicate.cancel.confirm'),
        onClick: handleConfirm,
      }}
    />
  );
};

export default CancelDuplicateArticleModal;
