"use client" import { cn } from "@/lib/utils" import type { ContentMode } from "./types" type EditorModeSwitchProps = { value: ContentMode disabled?: boolean onChange: (nextMode: ContentMode) => void } const MODE_OPTIONS: Array<{ value: ContentMode; label: string }> = [ { value: "markdown", label: "Markdown" }, { value: "html", label: "HTML" }, ] export function EditorModeSwitch({ value, disabled = false, onChange, }: EditorModeSwitchProps) { return (
{MODE_OPTIONS.map((option) => { const active = option.value === value return ( ) })}
) }