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

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

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

export const RemoveCoverPictureModal = ({
  onClose,
  onConfirm,
}: RemoveCoverPictureModalProps) => {
  const { t } = useLokaliseTranslation('general');

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

  return (
    <HuDialog
      onClose={onClose}
      title={t('cover_picture.delete.confirm.title')}
      textBody={t('cover_picture.delete.confirm.description')}
      secondaryButtonProps={{
        children: t('cancel'),
        onClick: onClose,
      }}
      primaryButtonProps={{
        children: t('cover_picture.delete.title'),
        onClick: handleConfirm,
      }}
    />
  );
};

export default RemoveCoverPictureModal;
