Interface SearchContextProps

The SearchContextProps interface represents the properties of the search context.

interface SearchContextProps {
    currentFilters: string[];
    currentPage: number;
    endDate: null | Date;
    fetchAndHandleResults: (
        newSearchQuery: SearchQueryDto,
        page: number,
    ) => void;
    isFilterPopupOpen: boolean;
    loading: boolean;
    parseQuery: () => SearchQueryDto;
    results: null | ResultDto[];
    searchQuery: string;
    setCurrentFilters: (filters: string[]) => void;
    setCurrentPage: (page: number) => void;
    setCurrentPageState: (page: number) => void;
    setEndDate: (date: null | Date) => void;
    setIsFilterPopupOpen: (isOpen: boolean) => void;
    setLoading: (loading: boolean) => void;
    setResults: (results: null | ResultDto[]) => void;
    setSearchQuery: (query: string) => void;
    setSortBy: (sort: string) => void;
    setStartDate: (date: null | Date) => void;
    setTotalPages: (pages: number) => void;
    setTotalResults: (results: number) => void;
    sortBy: string;
    startDate: null | Date;
    totalPages: number;
    totalResults: number;
}

Properties

currentFilters: string[]

The current filters.

currentPage: number

The current page number.

endDate: null | Date

The end date for the custom range filter.

fetchAndHandleResults: (newSearchQuery: SearchQueryDto, page: number) => void

The function to fetch and handle search results.

isFilterPopupOpen: boolean

The state of the filter popup.

loading: boolean

The current loading time.

parseQuery: () => SearchQueryDto

The function to parse the search query.

results: null | ResultDto[]

The current search results.

searchQuery: string

The current search query.

setCurrentFilters: (filters: string[]) => void

The function to update the current filters.

setCurrentPage: (page: number) => void

The function to update the current page number.

setCurrentPageState: (page: number) => void
setEndDate: (date: null | Date) => void

The function to update the end date.

setIsFilterPopupOpen: (isOpen: boolean) => void

The function to update the filter popup state.

setLoading: (loading: boolean) => void

The function to update the loading time.

setResults: (results: null | ResultDto[]) => void

The function to update the search results.

setSearchQuery: (query: string) => void

The function to update the search query.

setSortBy: (sort: string) => void

The function to update the sort order.

setStartDate: (date: null | Date) => void

The function to update the start date.

setTotalPages: (pages: number) => void

The function to update the total number of pages.

setTotalResults: (results: number) => void

The function to update the total number of results.

sortBy: string

The current sort order.

startDate: null | Date

The start date for the custom range filter.

totalPages: number

The total number of pages.

totalResults: number

The total number of results.