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:
@@ -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)} />;
|
||||
}
|
||||
Reference in New Issue
Block a user