feat: add optional onChange handler to TextFilter component

- Extended TextFilterProps to include an optional onChange callback
- Passed input value to onChange when TextField changes
- Enables consumers to handle input updates externally
This commit is contained in:
tekh 2025-07-15 15:32:01 +02:00
parent 8a43e88f24
commit f58fa0dd80

View File

@ -3,8 +3,9 @@ import TextField from '@mui/material/TextField';
type TextFilterProps = {
label: string;
onChange?: (value: string) => void;
}
export function TextFilter({ label }: TextFilterProps) {
return <TextField label={label} variant="filled" />;
export function TextFilter({ label, onChange }: TextFilterProps) {
return <TextField label={label} variant="filled" onChange={e => onChange?.(e.target.value)} />;
}