Skip to main content

Interface: UseProductSearchReturn

Defined in: composables/react/useProductSearch.ts:91

State and search actions returned by useProductSearch.

Properties

currentPage

currentPage: number

Defined in: composables/react/useProductSearch.ts:103

Current page number (1-based).


currentSortField

currentSortField: string

Defined in: composables/react/useProductSearch.ts:99

Active sort field.


currentSortOrder

currentSortOrder: string

Defined in: composables/react/useProductSearch.ts:101

Active sort direction.


displayProducts

displayProducts: (Product | Cluster)[]

Defined in: composables/react/useProductSearch.ts:93

Products to render — controlled products or the internally fetched list.


fetchProducts

fetchProducts: () => Promise<void>

Defined in: composables/react/useProductSearch.ts:115

Runs the main category product fetch.

Returns

Promise<void>


goToPage

goToPage: (page) => void

Defined in: composables/react/useProductSearch.ts:119

Navigates the main product list to a page.

Parameters

page

number

Returns

void


isLoading

isLoading: boolean

Defined in: composables/react/useProductSearch.ts:97

true while the main category fetch is in flight (uncontrolled mode only).


itemsFound

itemsFound: number

Defined in: composables/react/useProductSearch.ts:95

Total matching products across all pages.


search: (term) => void

Defined in: composables/react/useProductSearch.ts:117

Sets the search-bar term and triggers a debounced product search.

Parameters

term

string

Returns

void


searchItemsFound

searchItemsFound: number

Defined in: composables/react/useProductSearch.ts:111

Total items found by the search-bar query.


searchLoading

searchLoading: boolean

Defined in: composables/react/useProductSearch.ts:113

true while the debounced search-bar query is in flight.


searchResults

searchResults: (Product | Cluster)[]

Defined in: composables/react/useProductSearch.ts:109

Results of the debounced search-bar query.


searchTerm

searchTerm: string

Defined in: composables/react/useProductSearch.ts:107

The current search-bar term.


totalPages

totalPages: number

Defined in: composables/react/useProductSearch.ts:105

Total number of pages.