diff --git a/code/websites/pokedex.online/src/components/gamemaster/SearchBar.vue b/code/websites/pokedex.online/src/components/gamemaster/SearchBar.vue index 1569942..68e9792 100644 --- a/code/websites/pokedex.online/src/components/gamemaster/SearchBar.vue +++ b/code/websites/pokedex.online/src/components/gamemaster/SearchBar.vue @@ -80,12 +80,19 @@ const props = defineProps({ disabled: { type: Boolean, default: false + }, + searchState: { + type: Object, + default: null } }); const fileLines = toRef(props, 'fileLines'); const displayLines = toRef(props, 'displayLines'); +const internalSearchState = useGamemasterSearch(fileLines, displayLines); +const activeSearchState = computed(() => props.searchState || internalSearchState); + const { searchQuery, searchResults, @@ -100,7 +107,7 @@ const { currentResultLineNumber, resultCountDisplay, hasSearchResults -} = useGamemasterSearch(fileLines, displayLines); +} = activeSearchState.value; const isDisabled = computed( () => props.disabled || fileLines.value.length === 0