aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/client/pages/NoteTypesPage.tsx
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-12-31 02:49:55 +0900
committernsfisis <nsfisis@gmail.com>2025-12-31 02:49:55 +0900
commit6aa496b60879526b51fdf736c38f09aede283bde (patch)
treeeaeb4bc61ae10cd81f76e48047ad5f2193a53c38 /src/client/pages/NoteTypesPage.tsx
parentb51d4efaa1e5e0417d4306c02797f424938766cb (diff)
downloadkioku-6aa496b60879526b51fdf736c38f09aede283bde.tar.gz
kioku-6aa496b60879526b51fdf736c38f09aede283bde.tar.zst
kioku-6aa496b60879526b51fdf736c38f09aede283bde.zip
feat(client): add NoteTypeEditor component with field management
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>
Diffstat (limited to 'src/client/pages/NoteTypesPage.tsx')
-rw-r--r--src/client/pages/NoteTypesPage.tsx16
1 files changed, 9 insertions, 7 deletions
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}
/>