Dynamics list columns with a lot of work ahead

This commit is contained in:
2025-05-06 00:58:47 +02:00
parent 0613efa846
commit 2fed7fa4e7
7 changed files with 173 additions and 37 deletions

View File

@@ -1,5 +1,4 @@
import { Route, Routes } from "react-router";
import { useTranslation } from "@refinedev/core";
import List from "./base-page/List";
import Edit from "./base-page/Edit";
import New from "./base-page/New";
@@ -22,12 +21,12 @@ export const EntityRoutes = () => {
}
const ListEntity = () => {
const { translate: t } = useTranslation();
const columns = [
{ field: "entity_data", headerName: t("schemas.type"), width: 110, valueFormatter: ({ type }: {type: string}) => type },
{ field: "label", headerName: t("schemas.label"), flex: 1 },
{ field: "entity_data.type", column: { width: 110 }},
{ field: "label", column: { flex: 1 }},
{ field: "updated_at", column: { flex: 1 }},
];
return <List<Entity> resource={`entities`} columns={columns} />
return <List<Entity> resource={`entities`} schemaName={"Entity"} columns={columns} />
}
const EditEntity = () => {