import * as Yup from "yup";

import dayjs from "dayjs";

export const getInitialValues = (objectToEdit: any): any => {
  // console.log(objectToEdit?.name,"objectToEdit");
  const abilities = objectToEdit?.abilities?.map((item: any) => {
    return item?.id;
  });

  return {
    id: objectToEdit?.id ?? null,
    name: objectToEdit?.name ?? null,
    abilities: abilities ?? null,
  };
};

export const getValidationSchema = () => {
  // validate input
  return Yup.object().shape({
    name: Yup.string().required("validation.required"),
  });
};
