diff --git a/frontend/src/pages/search.tsx b/frontend/src/pages/search.tsx index 6b63317f0..dd84a9473 100644 --- a/frontend/src/pages/search.tsx +++ b/frontend/src/pages/search.tsx @@ -1,8 +1,18 @@ import type { GetStaticProps, NextPage } from "next"; +import { useFeatureFlags } from "src/hooks/useFeatureFlags"; import { serverSideTranslations } from "next-i18next/serverSideTranslations"; +import PageNotFound from "./404"; + const Search: NextPage = () => { + const { featureFlagsManager, mounted } = useFeatureFlags(); + + if (!mounted) return null; + if (!featureFlagsManager.isFeatureEnabled("showSearchV0")) { + return ; + } + return <>Search Boilerplate; }; @@ -10,11 +20,6 @@ const Search: NextPage = () => { export const getStaticProps: GetStaticProps = async ({ locale }) => { const translations = await serverSideTranslations(locale ?? "en"); - // TODO: update the statement below with a feature flag check - const hideSearchPage = true; - // redirects to default 404 page - if (hideSearchPage) return { notFound: true }; - return { props: { ...translations } }; };