Update Bridge file layout
This commit is contained in:
parent
2c43e81436
commit
b0fb643b6a
47 changed files with 2488 additions and 2087 deletions
|
|
@ -0,0 +1,3 @@
|
|||
export default function Page() {
|
||||
return <h1>Whatsapp edit</h1>;
|
||||
}
|
||||
6
apps/bridge-frontend/app/(main)/whatsapp/[id]/page.tsx
Normal file
6
apps/bridge-frontend/app/(main)/whatsapp/[id]/page.tsx
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
// import { db } from "@/app/_lib/database";
|
||||
|
||||
export default async function Page() {
|
||||
const rows = []; // await db.selectFrom("WhatsAppBot").
|
||||
return <h1>Whatsapp View</h1>;
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
"use client";
|
||||
|
||||
import { FC } from "react";
|
||||
import { GridColDef } from "@mui/x-data-grid-pro";
|
||||
import { List } from "@/app/_components/List";
|
||||
|
||||
type WhatsappListProps = {
|
||||
rows: any[];
|
||||
};
|
||||
|
||||
export const WhatsappList: FC<WhatsappListProps> = ({ rows }) => {
|
||||
const columns: GridColDef[] = [
|
||||
{
|
||||
field: "id",
|
||||
headerName: "ID",
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "phoneNumber",
|
||||
headerName: "Phone Number",
|
||||
flex: 2,
|
||||
},
|
||||
{
|
||||
field: "createdAt",
|
||||
headerName: "Created At",
|
||||
valueGetter: (params: any) =>
|
||||
new Date(params.row?.createdAt).toLocaleString(),
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "updatedAt",
|
||||
headerName: "Updated At",
|
||||
valueGetter: (params: any) =>
|
||||
new Date(params.row?.updatedAt).toLocaleString(),
|
||||
flex: 1,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<List
|
||||
title="WhatsApp Bots"
|
||||
entity="whatsapp"
|
||||
rows={rows}
|
||||
columns={columns}
|
||||
/>
|
||||
);
|
||||
};
|
||||
3
apps/bridge-frontend/app/(main)/whatsapp/new/page.tsx
Normal file
3
apps/bridge-frontend/app/(main)/whatsapp/new/page.tsx
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export default function Page() {
|
||||
return <h1>Whatsapp new</h1>;
|
||||
}
|
||||
11
apps/bridge-frontend/app/(main)/whatsapp/page.tsx
Normal file
11
apps/bridge-frontend/app/(main)/whatsapp/page.tsx
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { WhatsappList } from "./_components/WhatsappList";
|
||||
import { db } from "@/app/_lib/database";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function Page() {
|
||||
const rows = await db.selectFrom("WhatsappBot").selectAll().execute();
|
||||
console.log(rows);
|
||||
|
||||
return <WhatsappList rows={rows} />;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue