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

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

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

export const ConfirmDialog = ({ onClose, onConfirm }: ConfirmDialogProps) => {
  const { t } = useLokaliseTranslation('livestream');

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

export default ConfirmDialog;
