diff --git a/components/animate/AnimationEditor.tsx b/components/animate/AnimationEditor.tsx index 10afc35..8aad902 100644 --- a/components/animate/AnimationEditor.tsx +++ b/components/animate/AnimationEditor.tsx @@ -9,6 +9,7 @@ import { PresetLibrary } from './PresetLibrary'; import { ExportPanel } from './ExportPanel'; import { DEFAULT_CONFIG, newKeyframe } from '@/lib/animate/defaults'; import { cn } from '@/lib/utils/cn'; +import { MobileTabs } from '@/components/ui/mobile-tabs'; import type { AnimationConfig, KeyframeProperties as KFProps, PreviewElement } from '@/types/animate'; type MobileTab = 'edit' | 'preview'; @@ -75,23 +76,11 @@ export function AnimationEditor() { return (
{code}
diff --git a/components/ui/mobile-tabs.tsx b/components/ui/mobile-tabs.tsx
new file mode 100644
index 0000000..e72d371
--- /dev/null
+++ b/components/ui/mobile-tabs.tsx
@@ -0,0 +1,33 @@
+import { cn } from '@/lib/utils/cn';
+
+interface Tab {
+ value: string;
+ label: string;
+}
+
+interface MobileTabsProps {
+ tabs: Tab[];
+ active: string;
+ onChange: (value: string) => void;
+}
+
+export function MobileTabs({ tabs, active, onChange }: MobileTabsProps) {
+ return (
+
+ {tabs.map(({ value, label }) => (
+
+ ))}
+
+ );
+}
diff --git a/components/units/MainConverter.tsx b/components/units/MainConverter.tsx
index 2e1fa73..9a83dc6 100644
--- a/components/units/MainConverter.tsx
+++ b/components/units/MainConverter.tsx
@@ -14,6 +14,7 @@ import {
type ConversionResult,
} from '@/lib/units/units';
import { parseNumberInput, formatNumber, cn } from '@/lib/utils';
+import { MobileTabs } from '@/components/ui/mobile-tabs';
type Tab = 'category' | 'convert';
@@ -87,23 +88,11 @@ export default function MainConverter() {
return (
- {/* ── Mobile tab switcher ────────────────────────────────── */}
-
- {(['category', 'convert'] as Tab[]).map((t) => (
-
- ))}
-
+ setTab(v as Tab)}
+ />
{/* ── Main layout ────────────────────────────────────────── */}