import * as Yup from "yup";
import dayjs from "dayjs";
import { StudentStatusEnum } from "../../../../../../enums/Items";

export const getInitialValues = (objectToEdit: any): any => {
  return {
    id: objectToEdit?.id ?? null,
    attachment:
      objectToEdit?.[StudentStatusEnum?.EARLY_DEPARTURE]?.attachment ?? null,
    type: objectToEdit?.type ?? "justified",
    justification:
      objectToEdit?.[StudentStatusEnum?.EARLY_DEPARTURE]?.justification ?? null,
    departure_time: objectToEdit?.[StudentStatusEnum?.EARLY_DEPARTURE]
      ?.departure_time
      ? dayjs(
          objectToEdit?.[StudentStatusEnum?.EARLY_DEPARTURE]?.departure_time,
          "H:mm",
        )
      : null,
    status: StudentStatusEnum?.EARLY_DEPARTURE,
  };
};

export const getValidationSchema = () => {
  // validate input
  return Yup.object().shape({});
};
