diff --git a/frontend/src/components/ConfigFieldInput.tsx b/frontend/src/components/ConfigFieldInput.tsx new file mode 100644 index 0000000..41a5e4a --- /dev/null +++ b/frontend/src/components/ConfigFieldInput.tsx @@ -0,0 +1,140 @@ + +import type { ConfigFieldDto } from '@/services/configService'; +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 { Badge } from '@/components/ui/badge'; +import { Label } from '@/components/ui/label'; +import { Lock } from 'lucide-react'; + +interface ConfigFieldInputProps { + field: ConfigFieldDto; + value: any; + onChange: (value: any) => void; +} + +export function ConfigFieldInput({ field, value, onChange }: ConfigFieldInputProps) { + const isReadonly = !!field.readonly; + + const renderInput = () => { + const baseInputClasses = "bg-zinc-900/50 border-white/10 focus-visible:ring-primary focus-visible:border-primary transition-all duration-200" + (isReadonly ? " opacity-50 cursor-not-allowed" : ""); + switch (field.type) { + case 'boolean': + return ( + + ); + case 'enum': + return ( + + ); + case 'text': + return ( +