Adds Monsters and Locations
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
// DocumentRow.tsx
|
||||
// Generic row component for displaying any document type.
|
||||
import { SessionRow } from "@/components/documents/session/SessionRow";
|
||||
import { SecretRow } from "@/components/documents/secret/SecretRow";
|
||||
import { SessionRow } from "@/components/documents/session/SessionRow";
|
||||
import {
|
||||
isLocation,
|
||||
isMonster,
|
||||
isNpc,
|
||||
isScene,
|
||||
isSecret,
|
||||
@@ -11,9 +13,11 @@ import {
|
||||
type Document,
|
||||
type Session,
|
||||
} from "@/lib/types";
|
||||
import { TreasureRow } from "./treasure/TreasureRow";
|
||||
import { SceneRow } from "./scene/SceneRow";
|
||||
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";
|
||||
|
||||
/**
|
||||
* Renders a row for any document type. Prioritizes Session, then Secret, then falls back to ID and creation time.
|
||||
@@ -26,6 +30,14 @@ export const DocumentRow = ({
|
||||
document: Document;
|
||||
session?: Session;
|
||||
}) => {
|
||||
if (isLocation(document)) {
|
||||
return <LocationRow location={document} />;
|
||||
}
|
||||
|
||||
if (isMonster(document)) {
|
||||
return <MonsterRow monster={document} />;
|
||||
}
|
||||
|
||||
if (isNpc(document)) {
|
||||
return <NpcRow npc={document} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user