"use client"; import React from "react"; import { Input } from "@/components/ui/input"; import { Switch } from "@/components/ui/switch"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { Textarea } from "@/components/ui/textarea"; import { Label } from "@/components/ui/label"; import { Button } from "@/components/ui/button"; import { Plus, X } from "lucide-react"; import { ConfigFieldDefinition, ConfigOption } from "./ConfigPanelTypes"; interface ConfigFieldProps { field: ConfigFieldDefinition; value: any; onChange: (key: string, value: any) => void; tableColumns?: ConfigOption[]; } export function ConfigField({ field, value, onChange, tableColumns, }: ConfigFieldProps) { const handleChange = (newValue: any) => { onChange(field.key, newValue); }; const renderField = () => { switch (field.type) { case "text": return ( handleChange(e.target.value)} placeholder={field.placeholder} className="h-8 text-xs" /> ); case "number": return ( handleChange( e.target.value === "" ? undefined : Number(e.target.value), ) } placeholder={field.placeholder} min={field.min} max={field.max} step={field.step} className="h-8 text-xs" /> ); case "switch": return ( ); case "select": return ( ); case "textarea": return (