WIP: Adding entity crud to front

This commit is contained in:
2025-04-18 16:00:44 +02:00
parent fc5c63fe87
commit 155a5edd7d
5 changed files with 88 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import { CrudForm } from "../../../lib/crud/components/crud-form";
import { UiSchema } from "@rjsf/utils";
import { useParams } from "react-router";
type CardProps = {
resource: string,
schemaName: string,
uiSchema?: UiSchema,
}
const Card = (props: CardProps) => {
const { schemaName, resource, uiSchema } = props;
const { record_id } = useParams();
return (
<CrudForm
schemaName={schemaName}
uiSchema={uiSchema}
resource={resource}
id={record_id}
/>
)
}
export default Card;

View File

@@ -0,0 +1,23 @@
import { UiSchema } from "@rjsf/utils";
import { List as RefineList } from "@refinedev/mui";
import { DataGrid } from "@mui/x-data-grid";
type ListProps = {
resource: string,
schemaName?: string,
uiSchema?: UiSchema,
}
const List = (props: ListProps) => {
const { schemaName, resource, uiSchema } = props;
return (
<RefineList
resource={resource}
>
<DataGrid columns={} />
</RefineList>
)
}
export default List;

View File

@@ -0,0 +1,22 @@
import { CrudForm } from "../../../lib/crud/components/crud-form";
import { UiSchema } from "@rjsf/utils";
type NewProps = {
resource: string,
schemaName: string,
uiSchema?: UiSchema,
}
const New = (props: NewProps) => {
const { schemaName, resource, uiSchema } = props;
return (
<CrudForm
schemaName={schemaName}
uiSchema={uiSchema}
resource={resource}
/>
)
}
export default New;