From 6aa496b60879526b51fdf736c38f09aede283bde Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Wed, 31 Dec 2025 02:49:55 +0900
Subject: feat(client): add NoteTypeEditor component with field management
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Add a comprehensive editor for note types that allows users to:
- Edit note type name and templates
- Add, remove, and reorder fields
- Toggle the reversible card option

The editor fetches note type details including fields from the API,
enabling full CRUD operations for note type configuration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---
 src/client/pages/NoteTypesPage.tsx | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

(limited to 'src/client/pages/NoteTypesPage.tsx')

diff --git a/src/client/pages/NoteTypesPage.tsx b/src/client/pages/NoteTypesPage.tsx
index 0a34f5b..020b16c 100644
--- a/src/client/pages/NoteTypesPage.tsx
+++ b/src/client/pages/NoteTypesPage.tsx
@@ -13,7 +13,7 @@ import { Link } from "wouter";
 import { ApiClientError, apiClient } from "../api";
 import { CreateNoteTypeModal } from "../components/CreateNoteTypeModal";
 import { DeleteNoteTypeModal } from "../components/DeleteNoteTypeModal";
-import { EditNoteTypeModal } from "../components/EditNoteTypeModal";
+import { NoteTypeEditor } from "../components/NoteTypeEditor";
 
 interface NoteType {
 	id: string;
@@ -30,7 +30,9 @@ export function NoteTypesPage() {
 	const [isLoading, setIsLoading] = useState(true);
 	const [error, setError] = useState<string | null>(null);
 	const [isCreateModalOpen, setIsCreateModalOpen] = useState(false);
-	const [editingNoteType, setEditingNoteType] = useState<NoteType | null>(null);
+	const [editingNoteTypeId, setEditingNoteTypeId] = useState<string | null>(
+		null,
+	);
 	const [deletingNoteType, setDeletingNoteType] = useState<NoteType | null>(
 		null,
 	);
@@ -217,7 +219,7 @@ export function NoteTypesPage() {
 									<div className="flex items-center gap-2 shrink-0">
 										<button
 											type="button"
-											onClick={() => setEditingNoteType(noteType)}
+											onClick={() => setEditingNoteTypeId(noteType.id)}
 											className="p-2 text-muted hover:text-slate hover:bg-ivory rounded-lg transition-colors"
 											title="Edit note type"
 										>
@@ -254,10 +256,10 @@ export function NoteTypesPage() {
 				onNoteTypeCreated={fetchNoteTypes}
 			/>
 
-			<EditNoteTypeModal
-				isOpen={editingNoteType !== null}
-				noteType={editingNoteType}
-				onClose={() => setEditingNoteType(null)}
+			<NoteTypeEditor
+				isOpen={editingNoteTypeId !== null}
+				noteTypeId={editingNoteTypeId}
+				onClose={() => setEditingNoteTypeId(null)}
 				onNoteTypeUpdated={fetchNoteTypes}
 			/>
 
-- 
cgit v1.2.3-70-g09d2

