import { CrudForm } from "../../../lib/crud/components/crud-form";
import { UiSchema } from "@rjsf/utils";
import { useParams } from "react-router";

type EditProps = {
  resource: string,
  schemaName: string,
  uiSchema?: UiSchema,
}

const Edit = <T,>(props: EditProps) => {
  const { schemaName, resource, uiSchema } = props;
  const { record_id } = useParams();

  console.log(record_id);

  return (
    <CrudForm
      schemaName={schemaName}
      uiSchema={uiSchema}
      resource={resource}
      id={record_id}
      />
  )
}

export default Edit;
