add onGroupChange function parameter (can be null)
This commit is contained in:
parent
c21e4785ce
commit
a735ee8304
@ -13,13 +13,17 @@ import React from "react";
|
||||
interface Props {
|
||||
group: string;
|
||||
setGroup: (group: string) => void;
|
||||
onGroupChange: (() => void) | null;
|
||||
}
|
||||
|
||||
const groups = ["Favorites", "Team"];
|
||||
|
||||
const GroupSelect: React.FC<Props> = ({ group, setGroup }) => {
|
||||
const GroupSelect: React.FC<Props> = ({ group, setGroup, onGroupChange }) => {
|
||||
const handleChange = (e: SelectChangeEvent) => {
|
||||
setGroup(e.target.value);
|
||||
if (onGroupChange) {
|
||||
onGroupChange();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user