import BasicLayout from "@/core/components/layouts/BasicLayout"
import ProductSearch from "@/lib/product/components/ProductSearch"
import { useRouter } from "next/router"
import _ from "lodash-contrib"

export default function Search() {
  const router = useRouter()
  
  return (
    <BasicLayout>
      { !_.isEmpty(router.query) && (
        <ProductSearch
          query={router.query}
          prefixUrl="/shop/search"
        />
      ) }
    </BasicLayout>
  )
}