Generalize WIP

This commit is contained in:
Darren Clarke 2024-04-26 14:31:33 +02:00
parent a3e8b89128
commit cb7a3a08dc
31 changed files with 657 additions and 106 deletions

View file

@ -2,30 +2,29 @@
import { FC } from "react";
import { GridColDef } from "@mui/x-data-grid-pro";
import { WhatsappBot } from "@/app/_lib/database";
import { List } from "@/app/_components/List";
type WhatsappListProps = {
rows: any[];
rows: WhatsappBot[];
};
export const WhatsappList: FC<WhatsappListProps> = ({ rows }) => {
const columns: GridColDef[] = [
{
field: "id",
headerName: "ID",
field: "name",
headerName: "Name",
flex: 1,
},
{
field: "phoneNumber",
headerName: "Phone Number",
flex: 2,
flex: 1,
},
{
field: "createdAt",
headerName: "Created At",
valueGetter: (params: any) =>
new Date(params.row?.createdAt).toLocaleString(),
flex: 1,
field: "description",
headerName: "Description",
flex: 2,
},
{
field: "updatedAt",