1- import type { Metadata } from " next" ;
2- import Head from " next/head" ;
1+ import type { Metadata } from ' next'
2+ import Head from ' next/head'
33
4- import PageBuilderPage from " @/app/components/PageBuilder" ;
5- import { sanityFetch } from " @/sanity/lib/live" ;
6- import { getPageQuery , pagesSlugs } from " @/sanity/lib/queries" ;
7- import { GetPageQueryResult } from " @/sanity.types" ;
8- import { PageOnboarding } from " @/app/components/Onboarding" ;
4+ import PageBuilderPage from ' @/app/components/PageBuilder'
5+ import { sanityFetch } from ' @/sanity/lib/live'
6+ import { getPageQuery , pagesSlugs } from ' @/sanity/lib/queries'
7+ import { GetPageQueryResult } from ' @/sanity.types'
8+ import { PageOnboarding } from ' @/app/components/Onboarding'
99
1010type Props = {
11- params : Promise < { slug : string } > ;
12- } ;
11+ params : Promise < { slug : string } >
12+ }
1313
1414/**
1515 * Generate the static params for the page.
1616 * Learn more: https://nextjs.org/docs/app/api-reference/functions/generate-static-params
1717 */
1818export async function generateStaticParams ( ) {
19- const { data } = await sanityFetch ( {
19+ const { data} = await sanityFetch ( {
2020 query : pagesSlugs ,
2121 // // Use the published perspective in generateStaticParams
22- perspective : " published" ,
22+ perspective : ' published' ,
2323 stega : false ,
24- } ) ;
25- return data ;
24+ } )
25+ return data
2626}
2727
2828/**
2929 * Generate metadata for the page.
3030 * Learn more: https://nextjs.org/docs/app/api-reference/functions/generate-metadata#generatemetadata-function
3131 */
3232export async function generateMetadata ( props : Props ) : Promise < Metadata > {
33- const params = await props . params ;
34- const { data : page } = await sanityFetch ( {
33+ const params = await props . params
34+ const { data : page } = await sanityFetch ( {
3535 query : getPageQuery ,
3636 params,
3737 // Metadata should never contain stega
3838 stega : false ,
39- } ) ;
39+ } )
4040
4141 return {
4242 title : page ?. name ,
4343 description : page ?. heading ,
44- } satisfies Metadata ;
44+ } satisfies Metadata
4545}
4646
4747export default async function Page ( props : Props ) {
48- const params = await props . params ;
49- const [ { data : page } ] = await Promise . all ( [
50- sanityFetch ( { query : getPageQuery , params } ) ,
51- ] ) ;
48+ const params = await props . params
49+ const [ { data : page } ] = await Promise . all ( [ sanityFetch ( { query : getPageQuery , params} ) ] )
5250
5351 if ( ! page ?. _id ) {
5452 return (
5553 < div className = "py-40" >
5654 < PageOnboarding />
5755 </ div >
58- ) ;
56+ )
5957 }
6058
6159 return (
@@ -79,5 +77,5 @@ export default async function Page(props: Props) {
7977 </ div >
8078 < PageBuilderPage page = { page as GetPageQueryResult } />
8179 </ div >
82- ) ;
80+ )
8381}
0 commit comments