Moves editing into forms. Every doc has a page now. BUG: state not refreshed after mutation
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
// DocumentRow.tsx
|
||||
// Generic row component for displaying any document type.
|
||||
import { SecretRow } from "@/components/documents/secret/SecretRow";
|
||||
import { SessionRow } from "@/components/documents/session/SessionRow";
|
||||
import { SecretToggleRow } from "@/components/documents/secret/SecretToggleRow";
|
||||
import {
|
||||
isLocation,
|
||||
isMonster,
|
||||
@@ -13,11 +12,12 @@ import {
|
||||
type Document,
|
||||
type Session,
|
||||
} from "@/lib/types";
|
||||
import { LocationRow } from "./location/LocationRow";
|
||||
import { MonsterRow } from "./monsters/MonsterRow";
|
||||
import { NpcRow } from "./npc/NpcRow";
|
||||
import { SceneRow } from "./scene/SceneRow";
|
||||
import { TreasureRow } from "./treasure/TreasureRow";
|
||||
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 { TreasureToggleRow } from "./treasure/TreasureToggleRow";
|
||||
|
||||
/**
|
||||
* Renders a row for any document type. Prioritizes Session, then Secret, then falls back to ID and creation time.
|
||||
@@ -31,31 +31,31 @@ export const DocumentRow = ({
|
||||
session?: Session;
|
||||
}) => {
|
||||
if (isLocation(document)) {
|
||||
return <LocationRow location={document} />;
|
||||
return <LocationPrintRow location={document} />;
|
||||
}
|
||||
|
||||
if (isMonster(document)) {
|
||||
return <MonsterRow monster={document} />;
|
||||
return <MonsterPrintRow monster={document} />;
|
||||
}
|
||||
|
||||
if (isNpc(document)) {
|
||||
return <NpcRow npc={document} />;
|
||||
return <NpcPrintRow npc={document} />;
|
||||
}
|
||||
|
||||
if (isSession(document)) {
|
||||
return <SessionRow session={document} />;
|
||||
return <SessionPrintRow session={document} />;
|
||||
}
|
||||
|
||||
if (isSecret(document)) {
|
||||
return <SecretRow secret={document} session={session} />;
|
||||
return <SecretToggleRow secret={document} session={session} />;
|
||||
}
|
||||
|
||||
if (isScene(document)) {
|
||||
return <SceneRow scene={document} />;
|
||||
return <ScenePrintRow scene={document} />;
|
||||
}
|
||||
|
||||
if (isTreasure(document)) {
|
||||
return <TreasureRow treasure={document} session={session} />;
|
||||
return <TreasureToggleRow treasure={document} session={session} />;
|
||||
}
|
||||
|
||||
// Fallback: show ID and creation time
|
||||
|
||||
Reference in New Issue
Block a user