Fixes the copy on new sessions, some additional styling work
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user