import React from 'react'
import SearchUi from './SearchUi'
import SearchResults from './SearchResults'
import LoadingAnimation from '../Loading/LoadingAnimation'
import fetchSearchResultsFromAPI from '../../api/fetchPremiumTemplateKitSearchResults'
import ErrorLoadingData from '../Errors/ErrorLoadingData'
const SearchWrapper = ({ searchParams, onSearchSubmitted }) => {
const { loading, data, error } = fetchSearchResultsFromAPI(searchParams)
const aggregations = !error && !loading && data && data.results ? data.results.search_query_result.search_payload.aggregations : {}
return (
<>
{loading ? : null}
{error ? : null}
{!loading && !error && data
? (
)
: null}
>
)
}
export default SearchWrapper
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v17.0.2
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
@keyframes wc-skeleton-shimmer{to{transform:translateX(100%)}}.wp-block-woocommerce-product-review-template{box-sizing:border-box;list-style:none;margin-bottom:0;max-width:100%;padding:0}.wp-block-woocommerce-product-review-template li{clear:both}.wp-block-woocommerce-product-review-template ol{list-style:none;margin-bottom:0;max-width:100%;padding-left:2rem}.wp-block-woocommerce-product-review-template.alignleft{float:left}.wp-block-woocommerce-product-review-template.aligncenter{margin-left:auto;margin-right:auto;width:fit-content}.wp-block-woocommerce-product-review-template.alignright{float:right}