import { ScrollArea } from "@/components/ui/scroll-area"; import { useEditorStore } from "@/stores/editorStore"; import { renderMicron } from "./micronRenderer"; import { cn } from "@/lib/utils"; type PreviewMode = "ascii" | "micron" | "raw" | "script"; export default function PreviewPane() { const previewMode = useEditorStore((s) => s.previewMode); const setPreviewMode = useEditorStore((s) => s.setPreviewMode); const compiledAscii = useEditorStore((s) => s.compiledAscii); const compiledMicron = useEditorStore((s) => s.compiledMicron); const compiledScript = useEditorStore((s) => s.compiledScript); const isDynamic = useEditorStore((s) => s.isDynamic); const isCompiling = useEditorStore((s) => s.isCompiling); const compileError = useEditorStore((s) => s.compileError); const tabs: { value: PreviewMode; label: string; show: boolean }[] = [ { value: "ascii", label: "ASCII", show: true }, { value: "micron", label: "Micron", show: true }, { value: "raw", label: "Raw", show: true }, { value: "script", label: "Script", show: isDynamic }, ]; return (
{compiledAscii || (
ASCII preview will appear here…
)}
) : previewMode === "micron" ? (
compiledMicron ? (
) : (
{compiledScript || "No dynamic script generated."}
) : (
{compiledMicron || "Raw Micron output will appear here…"}
)}