"use client"; import { cn } from "@mdxui/primitives/lib/utils"; import { Tabs, TabsContent, TabsList, TabsTrigger, } from "@mdxui/primitives/tabs"; import { useCallback, useRef, useState } from "react"; import { EditorPane } from "../editor/editor-pane"; import type { EditorHandle } from "../editor-context"; import { PreviewPane } from "../preview/preview-pane"; interface MobileEditorTabsProps { content: string; onChange: (content: string) => void; path: string; isDirty?: boolean; isSaving?: boolean; onSave?: () => void; onClose?: () => void; } export function MobileEditorTabs({ content, onChange, path, isDirty, isSaving, onSave, onClose, }: MobileEditorTabsProps) { const [activeTab, setActiveTab] = useState("editor"); const editorHandleRef = useRef(null); // Jump to line using editor handle ref const handleJumpToLine = useCallback((line: number) => { // Switch to editor tab first setActiveTab("editor"); // Small delay to ensure tab switch completes, then jump requestAnimationFrame(() => { editorHandleRef.current?.jumpToLine(line); }); }, []); return ( Preview Editor {isDirty && ( )} ); }