search v1
This commit is contained in:
@@ -5,9 +5,26 @@ import type { Box } from '~/../types/types'
|
||||
export const useUiStore = defineStore('ui', {
|
||||
state: () => ({
|
||||
// UI-only state can live here later
|
||||
showSearch: false,
|
||||
searchQuery: ''
|
||||
}),
|
||||
|
||||
actions: {
|
||||
openSearch() {
|
||||
this.showSearch = true
|
||||
// reset query on open to avoid stale state
|
||||
this.searchQuery = ''
|
||||
},
|
||||
|
||||
closeSearch() {
|
||||
this.showSearch = false
|
||||
this.searchQuery = ''
|
||||
},
|
||||
|
||||
setSearchQuery(q: string) {
|
||||
this.searchQuery = q
|
||||
},
|
||||
|
||||
selectBox(id: string) {
|
||||
const dataStore = useDataStore()
|
||||
dataStore.boxes.forEach((box) => {
|
||||
|
||||
Reference in New Issue
Block a user