import Dialog 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 = () => {
    onConfirm?.();
    onClose();
  };

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