import { memo } from 'react'; import FieldWrapper from './FieldWrapper'; import TextInput from './TextInput'; import { clsx } from 'clsx'; interface TextFieldProps { field: { id: string; label?: string; placeholder?: string; is_lock?: boolean; tooltip?: any; context?: any; context_html?: string; prefix?: string; [key: string]: any; }; value: string; onChange: (value: string) => void; } const Text = ({ field, value, onChange }: TextFieldProps) => { const disabled = field.is_lock === true; return (
{field.prefix && ( {field.prefix} )} onChange(e.target.value)} disabled={disabled} className={clsx( "flex-1 border-none focus:ring-0 focus:border-none rounded-none", field.prefix ? "rounded-r-md" : "rounded-md" )} />
); }; export default memo(Text);