import React, { useState } from 'react'; export interface TextInputProps { placeholder?: string; label?: string; default?: string; onchange: (value: string) => void; } export const TextInput: React.FC = ({ placeholder = '', label = '', default: initial = '', onchange }) => { const [value, setValue] = useState(initial); const handleBlur = () => { onchange(value); }; return (
{label && } setValue(e.target.value)} onBlur={handleBlur} placeholder={placeholder} />
); };