Generalize WIP
This commit is contained in:
parent
a3e8b89128
commit
cb7a3a08dc
31 changed files with 657 additions and 106 deletions
|
|
@ -0,0 +1,27 @@
|
|||
import { db } from "@/app/_lib/database";
|
||||
import { serviceConfig } from "@/app/_lib/config";
|
||||
import { Detail } from "./_components/Detail";
|
||||
|
||||
type Props = {
|
||||
params: { service: string; segment: string[] };
|
||||
};
|
||||
|
||||
export default async function Page({ params: { service, segment } }: Props) {
|
||||
const id = segment?.[0];
|
||||
|
||||
if (!id) return null;
|
||||
|
||||
const {
|
||||
[service]: { table },
|
||||
} = serviceConfig;
|
||||
|
||||
const row = await db
|
||||
.selectFrom(table)
|
||||
.selectAll()
|
||||
.where("id", "=", id)
|
||||
.executeTakeFirst();
|
||||
|
||||
if (!row) return null;
|
||||
|
||||
return <Detail service={service} row={row} />;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue