"use client"; import { useState } from "react"; import { cn } from "@/lib/utils"; import { MonacoEditor } from "@/components/monaco-editor"; import type { LuaCompletions } from "@/lib/lua-completions"; interface CodePanelsProps { jsonValue: string; onJsonChange?: (value: string) => void; jsonReadOnly?: boolean; luaValue?: string | null; onLuaChange?: (value: string) => void; luaReadOnly?: boolean; luaCompletions?: LuaCompletions; collections?: string[]; className?: string; } function Panel({ className, label, value, onChange, readOnly, lang, completions, collections, }: { className?: string; label: string; value: string; onChange?: (value: string) => void; readOnly?: boolean; lang: string; completions?: LuaCompletions; collections?: string[]; }) { return (
{label}
); } export function CodePanels({ jsonValue, onJsonChange, jsonReadOnly, luaValue, onLuaChange, luaReadOnly, luaCompletions, collections, className, }: CodePanelsProps) { const hasLua = luaValue != null || !!onLuaChange; const [activeTab, setActiveTab] = useState<"json" | "lua">("json"); return (
{/* Narrow-screen tab switcher (only when Lua panel exists) */} {hasLua && (
)} {/* Single set of editors — CSS controls narrow/wide layout */}
{/* Wrapper stays in the DOM so the grid column can animate closed */}
{hasLua && ( )}
); }