From f8130f0ba96f25f2bfe731ccdebca062482c13f9 Mon Sep 17 00:00:00 2001 From: Drew Haven Date: Sat, 28 Jun 2025 18:01:15 -0700 Subject: [PATCH] Cleans up the new-doc forms. --- .../documents/location/NewLocationForm.tsx | 62 ++++++++----------- .../documents/monsters/NewMonsterForm.tsx | 38 ++++-------- src/components/documents/npc/NewNpcForm.tsx | 62 ++++++++----------- .../documents/secret/NewSecretForm.tsx | 34 +++++----- .../documents/treasure/NewTreasureForm.tsx | 33 ++++------ src/components/form/BaseForm.tsx | 6 +- src/components/form/MultiLineInput.tsx | 18 ++++-- src/components/form/SingleLineInput.tsx | 29 +++++++++ 8 files changed, 135 insertions(+), 147 deletions(-) create mode 100644 src/components/form/SingleLineInput.tsx diff --git a/src/components/documents/location/NewLocationForm.tsx b/src/components/documents/location/NewLocationForm.tsx index a9021df..d6c1f6d 100644 --- a/src/components/documents/location/NewLocationForm.tsx +++ b/src/components/documents/location/NewLocationForm.tsx @@ -1,6 +1,9 @@ import { useState } from "react"; import type { CampaignId, Location } from "@/lib/types"; import { pb } from "@/lib/pocketbase"; +import { BaseForm } from "@/components/form/BaseForm"; +import { MultiLineInput } from "@/components/form/MultiLineInput"; +import { SingleLineInput } from "@/components/form/SingleLineInput"; /** * Renders a form to add a new location. Calls onCreate with the new location document. @@ -42,42 +45,29 @@ export const NewLocationForm = ({ } return ( -
-

Create new location

-
- - setName(e.target.value)} - disabled={adding} - aria-label="Name" - /> -
-
- -