diff --git a/src/app/annotation-types/page.tsx b/src/app/annotation-types/page.tsx index e27cbd8..ef61c7f 100644 --- a/src/app/annotation-types/page.tsx +++ b/src/app/annotation-types/page.tsx @@ -11,7 +11,7 @@ type AnnotationType = { color: string; category: string; icon: string | null; - is_active: number; + is_active: boolean; created_at: number; }; diff --git a/src/app/page.tsx b/src/app/page.tsx index 7186458..6d7c62b 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -153,7 +153,7 @@ interface SpanLabelType { display_name: string; color: string; hotkey: string | null; - is_active: number; + is_active: boolean; sort_order: number; created_at: number; } diff --git a/src/app/span-label-types/page.tsx b/src/app/span-label-types/page.tsx index 9e82879..3b5c17d 100644 --- a/src/app/span-label-types/page.tsx +++ b/src/app/span-label-types/page.tsx @@ -10,7 +10,7 @@ type SpanLabelType = { display_name: string; color: string; hotkey: string | null; - is_active: number; + is_active: boolean; sort_order: number; created_at: number; }; diff --git a/src/components/CandleChart.tsx b/src/components/CandleChart.tsx index 383a5a3..a46b626 100644 --- a/src/components/CandleChart.tsx +++ b/src/components/CandleChart.tsx @@ -46,7 +46,7 @@ type AnnotationType = { color: string; category: string; icon: string | null; - is_active: number; + is_active: boolean; }; interface SpanAnnotation { @@ -69,7 +69,7 @@ interface SpanLabelType { display_name: string; color: string; hotkey: string | null; - is_active: number; + is_active: boolean; sort_order: number; created_at: number; } @@ -189,7 +189,7 @@ const CandleChart = forwardRef( try { const response = await fetch('/api/annotation-types'); const data = await response.json(); - setAnnotationTypes(data.filter((t: AnnotationType) => t.is_active === 1)); + setAnnotationTypes(data.filter((t: AnnotationType) => t.is_active)); return data; } catch (error) { console.error('Failed to fetch annotation types:', error); diff --git a/src/components/SpanAnnotationList.tsx b/src/components/SpanAnnotationList.tsx index 1f7ca97..d633c38 100644 --- a/src/components/SpanAnnotationList.tsx +++ b/src/components/SpanAnnotationList.tsx @@ -23,7 +23,7 @@ interface SpanLabelType { display_name: string; color: string; hotkey: string | null; - is_active: number; + is_active: boolean; sort_order: number; created_at: number; } diff --git a/src/components/SpanAnnotationManager.tsx b/src/components/SpanAnnotationManager.tsx index bb140bb..58c1d13 100644 --- a/src/components/SpanAnnotationManager.tsx +++ b/src/components/SpanAnnotationManager.tsx @@ -33,7 +33,7 @@ interface SpanLabelType { display_name: string; color: string; hotkey: string | null; - is_active: number; + is_active: boolean; sort_order: number; created_at: number; } @@ -461,7 +461,7 @@ export default function SpanAnnotationManager({ // Hotkey label assignment: only when span tool is active and a span range is selected (after first click) if (activeTool === 'span' && interactionState === 'first-click-done' && startCandle) { // Check if key matches any label hotkey - const matchingLabel = spanLabelTypes.find((lt) => lt.hotkey === e.key && lt.is_active === 1); + const matchingLabel = spanLabelTypes.find((lt) => lt.hotkey === e.key && lt.is_active); if (matchingLabel && activeChartId) { e.preventDefault(); diff --git a/src/components/SpanPopover.tsx b/src/components/SpanPopover.tsx index 6b27ab9..24ab61e 100644 --- a/src/components/SpanPopover.tsx +++ b/src/components/SpanPopover.tsx @@ -28,7 +28,7 @@ interface SpanLabelType { display_name: string; color: string; hotkey: string | null; - is_active: number; + is_active: boolean; sort_order: number; created_at: number; } @@ -136,7 +136,7 @@ export default function SpanPopover({ {spanLabelTypes - .filter((type) => type.is_active === 1) + .filter((type) => type.is_active) .sort((a, b) => a.sort_order - b.sort_order) .map((type) => ( diff --git a/src/components/Toolbox.tsx b/src/components/Toolbox.tsx index 6f7ac75..d29f457 100644 --- a/src/components/Toolbox.tsx +++ b/src/components/Toolbox.tsx @@ -13,7 +13,7 @@ type AnnotationType = { color: string; category: string; icon: string | null; - is_active: number; + is_active: boolean; }; interface Annotation { @@ -44,7 +44,7 @@ interface SpanLabelType { display_name: string; color: string; hotkey: string | null; - is_active: number; + is_active: boolean; sort_order: number; created_at: number; } @@ -95,7 +95,7 @@ export default function Toolbox({ const res = await fetch('/api/annotation-types'); if (res.ok) { const data = await res.json(); - setAnnotationTypes(data.filter((t: AnnotationType) => t.is_active === 1)); + setAnnotationTypes(data.filter((t: AnnotationType) => t.is_active)); } } catch (error) { console.error('Failed to fetch annotation types:', error);