diff --git a/src/app/(sok)/_components/Search.jsx b/src/app/(sok)/_components/Search.jsx index 927661bb7..bdd9c2811 100644 --- a/src/app/(sok)/_components/Search.jsx +++ b/src/app/(sok)/_components/Search.jsx @@ -1,7 +1,9 @@ import React, { useEffect, useState } from "react"; import PropTypes from "prop-types"; -import { Alert, HGrid, Hide, Show, VStack } from "@navikt/ds-react"; +import { Alert, BodyShort, Box, Heading, HGrid, Hide, Show, VStack } from "@navikt/ds-react"; import { FETCH_SEARCH_WITHIN_DISTANCE_ERROR } from "@/app/(sok)/_utils/fetchTypes"; +import useSearchQuery from "@/app/(sok)/_components/SearchQueryProvider"; +import { useSearchParams } from "next/navigation"; import SearchResult from "./searchResult/SearchResult"; import DoYouWantToSaveSearch from "./howToPanels/DoYouWantToSaveSearch"; import Feedback from "./feedback/Feedback"; @@ -18,12 +20,32 @@ export default function Search({ searchResult, aggregations, locations, postcode const failedToSearchForPostcodes = errors.length > 0 && errors.find((error) => error.type === FETCH_SEARCH_WITHIN_DISTANCE_ERROR); + const searchQuery = useSearchQuery(); + const searchParams = useSearchParams(); + useEffect(() => { logAmplitudeEvent("Stillinger - Utførte søk"); }, []); return (
+ {searchParams.get("q") === "hack123" && ( + + searchQuery + size: {searchQuery.size} + typeof size: {typeof searchQuery.size} + typeof has: {typeof searchQuery.has} + has("v"): {searchQuery.has("v") ? "true" : "false"} + get("v"): {searchQuery.get("v")} + + searchQuery.urlSearchParams + size: {searchQuery.urlSearchParams.size} + typeof size: {typeof searchQuery.urlSearchParams.size} + typeof has: {typeof searchQuery.urlSearchParams.has} + has("v"): {searchQuery.urlSearchParams.has("v") ? "true" : "false"} + get("v"): {searchQuery.urlSearchParams.get("v")} + + )}