import { useMatch } from 'react-router';

import { coursesRoutes } from '../routes';

const useCourseStatus = () => {
  const isEdit = !!useMatch(coursesRoutes.editCourse());
  const isDuplicate = !!useMatch(coursesRoutes.duplicateCourse());
  const isDraftEdit = !!useMatch(coursesRoutes.draftCourse());
  const isCreate = !!useMatch(coursesRoutes.newCourse());

  return {
    isEdit,
    isDuplicate,
    isDraftEdit,
    isCreate,
  };
};

export default useCourseStatus;
