WIP: Linking in document list. Working on copying relationships to new sessions

This commit is contained in:
2025-06-27 17:52:57 -07:00
parent 93536b0ac2
commit 611eaca5b6
15 changed files with 281 additions and 52 deletions

View File

@@ -12,11 +12,7 @@ import {
type Document,
type Session,
} from "@/lib/types";
import { LocationPrintRow } from "./location/LocationPrintRow";
import { MonsterPrintRow } from "./monsters/MonsterPrintRow";
import { NpcPrintRow } from "./npc/NpcPrintRow";
import { ScenePrintRow } from "./scene/ScenePrintRow";
import { SessionPrintRow } from "./session/SessionPrintRow";
import { BasicRow } from "./BasicRow";
import { TreasureToggleRow } from "./treasure/TreasureToggleRow";
/**
@@ -31,19 +27,37 @@ export const DocumentRow = ({
session?: Session;
}) => {
if (isLocation(document)) {
return <LocationPrintRow location={document} />;
return (
<BasicRow
doc={document}
title={document.data.location.name}
description={document.data.location.description}
/>
);
}
if (isMonster(document)) {
return <MonsterPrintRow monster={document} />;
return <BasicRow doc={document} title={document.data.monster.name} />;
}
if (isNpc(document)) {
return <NpcPrintRow npc={document} />;
return (
<BasicRow
doc={document}
title={document.data.npc.name}
description={document.data.npc.description}
/>
);
}
if (isSession(document)) {
return <SessionPrintRow session={document} />;
return (
<BasicRow
doc={document}
title={document.created}
description={document.data.session.strongStart}
/>
);
}
if (isSecret(document)) {
@@ -51,7 +65,7 @@ export const DocumentRow = ({
}
if (isScene(document)) {
return <ScenePrintRow scene={document} />;
return <BasicRow doc={document} title={document.data.scene.text} />;
}
if (isTreasure(document)) {