link-stack/apps/bridge-frontend/app/(main)/webhooks/[[...segment]]/@detail/page.tsx

25 lines
483 B
TypeScript
Raw Normal View History

2024-04-25 13:36:50 +02:00
import { db } from "@/app/_lib/database";
import { Detail } from "./_components/Detail";
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("Webhook")
.selectAll()
.where("id", "=", id)
.executeTakeFirst();
if (!row) return null;
return <Detail row={row} />;
}