working on search page

This commit is contained in:
nospeedlimitindonesia
2024-07-27 19:51:34 +00:00
parent 01facb5c25
commit 459c703fb8
4 changed files with 73 additions and 59 deletions

View File

@@ -44,7 +44,7 @@ const SearchIcon = styled.svg`
pointer-events: none;
`;
export default function SearchInput({ shopId, autofocus }) {
export default function SearchInput({ shopId, autofocus, onSearchChange }) {
const [songName, setSongName] = useState("");
const [debouncedSongName, setDebouncedSongName] = useState("");
const navigate = useNavigate();
@@ -78,6 +78,7 @@ export default function SearchInput({ shopId, autofocus }) {
navigate(`/${shopId}`);
}
}
if (onSearchChange) onSearchChange(songName);
}
}, [songName]);