Adds NPCs

This commit is contained in:
2025-05-31 22:39:53 -07:00
parent 4bed1c6e65
commit f3bfb2736c
8 changed files with 225 additions and 8 deletions

View File

@@ -3,6 +3,7 @@
import { SessionRow } from "@/components/documents/session/SessionRow";
import { SecretRow } from "@/components/documents/secret/SecretRow";
import {
isNpc,
isScene,
isSecret,
isSession,
@@ -12,6 +13,7 @@ import {
} from "@/lib/types";
import { TreasureRow } from "./treasure/TreasureRow";
import { SceneRow } from "./scene/SceneRow";
import { NpcRow } from "./npc/NpcRow";
/**
* Renders a row for any document type. Prioritizes Session, then Secret, then falls back to ID and creation time.
@@ -24,10 +26,14 @@ export const DocumentRow = ({
document: Document;
session?: Session;
}) => {
if (isNpc(document)) {
return <NpcRow npc={document} />;
}
if (isSession(document)) {
// Use SessionRow for session documents
return <SessionRow session={document} />;
}
if (isSecret(document)) {
return <SecretRow secret={document} session={session} />;
}