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:
parent
8a43e88f24
commit
f58fa0dd80
@ -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)} />;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user