Download src/store/headerSearchStore.js from shimen/kirway: direct link, hf CLI and curl.
- Browser
- Download file 513 Bytes
-
https://huggingface.co/spaces/shimen/kirway/resolve/main/src/store/headerSearchStore.js
- Command line
-
hf download hf://spaces/shimen/kirway/src/store/headerSearchStore.js
-
curl -L -o headerSearchStore.js https://huggingface.co/spaces/shimen/kirway/resolve/main/src/store/headerSearchStore.js
513 Bytes
| /** | |
| * Header Search Store — Zustand-based reusable search input in Header. | |
| * Pages register placeholder on mount, read query, unregister on unmount. | |
| */ | |
| import { create } from "zustand"; | |
| export const useHeaderSearchStore = create((set) => ({ | |
| query: "", | |
| placeholder: "", | |
| visible: false, | |
| setQuery: (query) => set({ query }), | |
| register: (placeholder = "Search...") => | |
| set({ visible: true, placeholder, query: "" }), | |
| unregister: () => set({ visible: false, placeholder: "", query: "" }), | |
| })); | |