import { useDrawerV2 } from '@material-hu/hooks/useDrawerV2';

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

import { CourseDetail } from '../CourseDetail';

const useSeeCourseDrawer = (courseId: number) => {
  const { t } = useLokaliseTranslation('learning');

  return useDrawerV2(args => ({
    title: t('path.courses.information'),
    primaryButtonProps: {
      children: t('general:exit'),
      onClick: () => args.closeDrawer(),
      sx: { width: '100%' },
    },
    children: (
      <CourseDetail
        courseId={courseId}
        open={args.open}
      />
    ),
  }));
};

export default useSeeCourseDrawer;
