import { productListControlsStore } from '../../../store/productListControls';
import { productListDataStore } from '../../../store/productListData';

// Initialize stores for stories to prevent issues with uninitialized stores
export const initializeStores = () => {
    // Set initial values for productListControlsStore
    productListControlsStore.setState({
        isFiltersVisible: true,
        viewType: null,
        setViewType: () => {},
        setFiltersVisible: () => {},
        listingSidebarTitle: null,
        setListingSidebarTitle: () => {}
    });

    // Set initial values for productListDataStore
    productListDataStore.setState({
        searchResultCount: 0,
        sortBy: null,
        filtersQuery: [],
        nAppliedFilters: 0,
        filtersDetails: {},
        listingPage: null,
        isNavigateFromSearchBar: false,
        listingLastPage: null,
        listingCategories: [],
        isRatingsVisible: true,
        setListingPage: () => {},
        setSortBy: () => {},
        setFiltersQuery: () => {},
        setFiltersDetails: () => {},
        setListingCategories: () => {},
        setIsRatingsVisible: () => {}
    });
};

export default initializeStores;
