ported schema builder
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Sticky } from "@/lib/sticky";
|
||||
import { prisma } from "@/prisma/prismaClient";
|
||||
import Link from "next/link";
|
||||
|
||||
export default async function GameSystem(
|
||||
{ params: { id } }: { params: { id: string } },
|
||||
@@ -35,15 +35,25 @@ export default async function GameSystem(
|
||||
<h1>{gameSystem?.name}</h1>
|
||||
</section>
|
||||
<section>
|
||||
<ul>
|
||||
{gameSystem?.schemas.map((schema) => (
|
||||
<li key={schema.id}>{schema.name}</li>
|
||||
))}
|
||||
</ul>
|
||||
<>
|
||||
<div>
|
||||
<Link
|
||||
className="btn-primary mb-6 block w-min whitespace-nowrap"
|
||||
href={`/game-systems/${id}/schema/create`}
|
||||
>
|
||||
Create New Schema
|
||||
</Link>
|
||||
</div>
|
||||
<ul>
|
||||
{gameSystem?.schemas.map((schema) => (
|
||||
<li key={schema.id}>{schema.name}</li>
|
||||
))}
|
||||
{!gameSystem?.schemas.length && (
|
||||
<li>No schemas for {gameSystem?.name}</li>
|
||||
)}
|
||||
</ul>
|
||||
</>
|
||||
</section>
|
||||
<Sticky sidedness={-1}>
|
||||
<h1>HELLO!</h1>
|
||||
</Sticky>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
21
app/game-systems/[id]/schema/[schemaId]/page.tsx
Normal file
21
app/game-systems/[id]/schema/[schemaId]/page.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Heading } from "@/components/heading";
|
||||
import { SchemaBuilder } from "@/components/schema";
|
||||
import { prisma } from "@/prisma/prismaClient";
|
||||
|
||||
export default async function CreateSchemaForGameSystem(
|
||||
{ params }: { params: { id: string } },
|
||||
) {
|
||||
const gs = await prisma.gameSystem.findFirst({
|
||||
where: { id: params.id },
|
||||
select: { name: true },
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
<Heading title={gs?.name || ""} strapline="Schemas" />
|
||||
<section>
|
||||
<SchemaBuilder></SchemaBuilder>
|
||||
</section>
|
||||
</>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user