11import {
22 getSite ,
3- queryPurrfectStreamBySlug ,
43 queryPurrfectStreamByScheduled ,
54} from '@/services/notion.server' ;
65import { NextSeo } from 'next-seo' ;
76import Layout from '@/layout/Layout' ;
87import { Site } from '@/models/site.model' ;
9- import { Post , PostType } from '@/models/post.model' ;
8+ import { Post } from '@/models/post.model' ;
109import { GetStaticPaths , GetStaticProps , InferGetStaticPropsType } from 'next' ;
1110import ScheduleUpper from '@/components/ScheduleUpper' ;
1211import ScheduleCard from '@/components/ScheduleCard' ;
13- import DefaultErrorPage from 'next/error' ;
14- import AJLoading from '@/components/global/icons/AJLoading' ;
15- import { useRouter } from 'next/router' ;
1612
1713interface StaticParams {
1814 site : Site ;
@@ -33,7 +29,7 @@ export const getStaticPaths: GetStaticPaths = async () => {
3329 }
3430 return {
3531 paths,
36- fallback : true ,
32+ fallback : 'blocking' ,
3733 } ;
3834} ;
3935
@@ -72,24 +68,6 @@ export default function SchedulePage({
7268 site,
7369 post,
7470} : InferGetStaticPropsType < typeof getStaticProps > ) {
75- const router = useRouter ( ) ;
76- if ( router . isFallback ) {
77- return (
78- < Layout site = { site } >
79- < section className = "max-w-md p-10 mx-auto" >
80- < h1 > Loading...</ h1 >
81- < AJLoading className = "w-full h-auto" />
82- </ section >
83- </ Layout >
84- ) ;
85- }
86- if ( ! post ) {
87- return (
88- < Layout site = { site } >
89- < DefaultErrorPage statusCode = { 404 } />
90- </ Layout >
91- ) ;
92- }
9371 let re = / ( \w + ) .n u l l - / ;
9472 const title = post ?. title ?. replace ( re , '' ) ;
9573 return (
0 commit comments