import { FC } from 'react';

import NewModal from '@material-hu/components/deprecated/NewModal';
import { useLokaliseTranslation } from 'src/utils/i18n';

export enum FeaturesNotAvailable {
  VIDEO_CALL = 'VIDEO_CALL',
  CALL = 'CALL',
  LIVE_STREAM = 'LIVE_STREAM',
}

type FeatureNotAvailableModalProps = {
  featureName: FeaturesNotAvailable;
  onAccept: () => void;
};

export const FeatureNotAvailableModal: FC<
  FeatureNotAvailableModalProps
> = props => {
  const { featureName, onAccept } = props;

  const { t } = useLokaliseTranslation('web_only');

  return (
    <NewModal
      title={t('feature_not_available.feature_not_available_title', {
        featureName: t(featureName),
      })}
      textBody={t('feature_not_available.contact_support')}
      primaryButtonProps={{
        children: t('feature_not_available.accept'),
        onClick: onAccept,
        color: 'primary',
      }}
      onClose={onAccept}
    />
  );
};

export default FeatureNotAvailableModal;
