Searching.ton
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.3 KiB

2 years ago
import { Suspense } from "react"
import Layout from "app/core/layouts/Layout"
2 years ago
2 years ago
import { Routes, BlitzPage } from "@blitzjs/next"
import Search from "app/core/pages/Search"
import { ErrorBoundary } from "@blitzjs/next"
import { gSSP } from "app/blitz-server"
import {
serverSideProps,
ServerSidePropsContext,
} from "app/core/contextProviders/serverSidePropsProvider"
2 years ago
import ContextProviders from "app/core/components/ContextProviders"
2 years ago
function ErrorFallback({ error, resetErrorBoundary }) {
return (
<div role="alert">
<p>Something went wrong:</p>
<pre>{error.message}</pre>
<button onClick={resetErrorBoundary}>Try again</button>
</div>
)
}
const SearchPage: BlitzPage = (props) => {
// const currentUser = useCurrentUser()
return (
<ErrorBoundary
FallbackComponent={ErrorFallback}
onReset={() => {
// reset the state of your app so the error doesn't happen again
}}
>
2 years ago
<ContextProviders contextParamsServer={props}>
2 years ago
<Layout title="Searching | Search">
<Suspense fallback="Loading....">
2 years ago
<Search />
</Suspense>
</Layout>
2 years ago
</ContextProviders>
2 years ago
</ErrorBoundary>
)
}
2 years ago
export const getServerSideProps = gSSP(serverSideProps())
2 years ago
export default SearchPage