import { useState } from "react" import { Info } from "lucide-react" import type { AdminField } from "@/lib/types" import { cn } from "@/lib/utils" import { Badge } from "./ui/badge" import { Checkbox } from "./ui/checkbox" import { Input } from "./ui/input" import { Label } from "./ui/label" import { Select } from "./ui/select" import { Textarea } from "./ui/textarea" import { ModelCombobox } from "./ModelCombobox" import { PoolEditor } from "./PoolEditor" interface FieldControlProps { field: AdminField value: string modelOptions: string[] onValueChange: (key: string, value: string) => void onMessage: (text: string, kind?: string) => void } export function FieldControl({ field, value, modelOptions, onValueChange, onMessage, }: FieldControlProps) { if (field.pool_supported) { return ( onValueChange(field.key, next)} onMessage={onMessage} /> ) } switch (field.type) { case "boolean": return ( onValueChange(field.key, checked === true ? "true" : "false") } /> ) case "select": return ( ) case "textarea": return (