import Dialog, {
  type DialogProps,
} from '@material-hu/components/design-system/Dialog';

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

type PublishPathDialogProps = DialogProps & {
  onPublishPath: () => void;
  loading: boolean;
};

export const PublishPathDialog = ({
  onPublishPath,
  onClose,
  loading,
}: PublishPathDialogProps) => {
  const { t } = useLokaliseTranslation('learning');

  return (
    <Dialog
      onClose={onClose}
      title={t('path.publish.modal.title')}
      textBody={t('path.publish.modal.description')}
      primaryButtonProps={{
        children: t('path.publish.title'),
        onClick: onPublishPath,
        loading,
        disabled: loading,
      }}
      secondaryButtonProps={{
        children: t('general:cancel'),
        onClick: onClose,
        disabled: loading,
      }}
    />
  );
};
