link-stack/apps/bridge-frontend/app/(main)/facebook/[[...segment]]/@edit/page.tsx
2024-04-25 12:31:03 +02:00

24 lines
481 B
TypeScript

import { db } from "@/app/_lib/database";
import { Edit } from "./_components/Edit";
export const dynamic = "force-dynamic";
type Props = {
params: { segment: string[] };
};
export default async function Page({ params: { segment } }: Props) {
const id = segment?.[0];
if (!id) return null;
const row = await db
.selectFrom("FacebookBot")
.selectAll()
.where("id", "=", id)
.executeTakeFirst();
if (!row) return null;
return <Edit row={row} />;
}