Create/detail updates

This commit is contained in:
Darren Clarke 2024-04-24 21:44:05 +02:00
parent b0fb643b6a
commit 0997e449bb
26 changed files with 684 additions and 108 deletions

View file

@ -3,7 +3,8 @@
import { FC } from "react";
import { GridColDef } from "@mui/x-data-grid-pro";
import { useRouter } from "next/navigation";
import { List as InternalList } from "ui";
import { List as InternalList, Button } from "ui";
import { colors } from "ui";
interface ListProps {
title: string;
@ -14,6 +15,7 @@ interface ListProps {
export const List: FC<ListProps> = ({ title, entity, rows, columns }) => {
const router = useRouter();
const { mediumBlue } = colors;
const onRowClick = (id: string) => {
router.push(`/${entity}/${id}`);
@ -25,6 +27,9 @@ export const List: FC<ListProps> = ({ title, entity, rows, columns }) => {
rows={rows}
columns={columns}
onRowClick={onRowClick}
buttons={
<Button text="New" color={mediumBlue} href={`/${entity}/create`} />
}
/>
);
};