import { LibraryNotificationType } from 'src/types/library';
import { useLokaliseTranslation } from 'src/utils/i18n';

import FormRadioGroup, {
  FormRadioGroupProps,
} from 'src/components/FormInputs/FormRadioGroup';

const NotificationOptions = (props: Partial<FormRadioGroupProps>) => {
  const { t } = useLokaliseTranslation('libraries');

  const options = [
    {
      value: LibraryNotificationType.PUSH,
      label: t('general:notification.send_by.only_push'),
    },
    {
      value: LibraryNotificationType.EMAIL,
      label: t('general:notification.send_by.only_email'),
    },
    {
      value: LibraryNotificationType.BOTH,
      label: t('general:notification.send_by.both'),
    },
  ];

  return (
    <FormRadioGroup
      name="notificationType"
      options={options}
      column
      radioProps={{ size: 'small', sx: { py: 0 } }}
      {...props}
    />
  );
};

export default NotificationOptions;
