ported schema builder

This commit is contained in:
2024-03-19 14:49:50 -06:00
parent 56f0442d33
commit 3a5fe1911a
38 changed files with 4112 additions and 37 deletions

View File

@@ -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>
</>
);
}

View 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>
</>
);
}