import { LearningSegmentation } from 'src/pages/dashboard/Learning/common/components/LearningSegmentation';
import { useLokaliseTranslation } from 'src/utils/i18n';

import { useSessionStatus } from '../../../hooks/useSessionStatus';
import { newSessionFields } from '../../form';

const SessionSegmentation = () => {
  const { t } = useLokaliseTranslation('learning');
  const { blockSessionEdition } = useSessionStatus();

  return (
    <LearningSegmentation
      errorMessage={t(`session.segmentation.error`)}
      name={newSessionFields.segmentation.all()}
      disabled={blockSessionEdition}
    />
  );
};

export default SessionSegmentation;
