import { useEffect, useState } from 'react'; import { LanguageCombobox } from '../components/LanguageCombobox'; import { FieldType } from './types'; interface ValueRendererProps { value: string; onChange: (v: string) => void; } interface LeafValueEditorProps extends ValueRendererProps { type: FieldType; } /** * Type-dispatched leaf value editor. Used by both the single-leaf editor * (KVLeafEditor) and the per-row editor in the file-detail view. */ export function LeafValueEditor({ type, value, onChange }: LeafValueEditorProps) { switch (type) { case 'bool': return ( ); case 'number': return ( onChange(e.target.value)} /> ); case 'datetime': return ; case 'lang': return ; case 'url': return (
onChange(e.target.value)} /> {value && ( open ↗ )}
); case 'json': return (