24 lines
480 B
TypeScript
24 lines
480 B
TypeScript
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("User")
|
|
.selectAll()
|
|
.where("id", "=", id)
|
|
.executeTakeFirst();
|
|
|
|
if (!row) return null;
|
|
|
|
return <Detail row={row} />;
|
|
}
|