Create/detail updates
This commit is contained in:
parent
b0fb643b6a
commit
0997e449bb
26 changed files with 684 additions and 108 deletions
|
|
@ -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`} />
|
||||
}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue