Fixes the copy on new sessions, some additional styling work

This commit is contained in:
2025-06-28 17:48:56 -07:00
parent c00eb1d965
commit 6ce462a77d
20 changed files with 268 additions and 91 deletions

View File

@@ -1,4 +1,8 @@
import { RelationshipType, type CampaignId, type Document } from "@/lib/types";
import {
RelationshipType,
type CampaignId,
type AnyDocument,
} from "@/lib/types";
import { NewLocationForm } from "./location/NewLocationForm";
import { NewMonsterForm } from "./monsters/NewMonsterForm";
import { NewNpcForm } from "./npc/NewNpcForm";
@@ -6,10 +10,6 @@ import { NewSceneForm } from "./scene/NewSceneForm";
import { NewSecretForm } from "./secret/NewSecretForm";
import { NewTreasureForm } from "./treasure/NewTreasureForm";
function assertUnreachable(_x: never): never {
throw new Error("DocumentForm switch is not exhaustive");
}
/**
* Renders a form for any document type depending on the relationship.
*/
@@ -20,7 +20,7 @@ export const NewRelatedDocumentForm = ({
}: {
campaignId: CampaignId;
relationshipType: RelationshipType;
onCreate: (document: Document) => Promise<void>;
onCreate: (doc: AnyDocument) => Promise<void>;
}) => {
switch (relationshipType) {
case RelationshipType.Locations:
@@ -38,6 +38,4 @@ export const NewRelatedDocumentForm = ({
case RelationshipType.DiscoveredIn:
return "Form not supported here";
}
return assertUnreachable(relationshipType);
};