This commit is contained in:
hamid zarghami
2025-04-15 17:01:59 +03:30
parent afacc7c488
commit a2e22bfc01
2 changed files with 9 additions and 8 deletions
+6 -5
View File
@@ -1,17 +1,18 @@
import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query'
import { blogSingleQueryOptions, mostVisitedBlogsQueryOptions } from '../hooks/useBlogsData'
import SingleBlogPage from '../components/SingleBlogPage'
import { blogSingleQueryOptions } from '../hooks/useBlogsData'
// import SingleBlogPage from '../components/SingleBlogPage'
import { NextPage } from 'next'
const SingleBlog: NextPage<{ params: { id: string } }> = async ({ params }) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const SingleBlog: NextPage<any> = async ({ params }) => {
const queryClient = new QueryClient()
await queryClient.prefetchQuery(blogSingleQueryOptions(params.id))
await queryClient.prefetchQuery(mostVisitedBlogsQueryOptions)
return (
<HydrationBoundary state={dehydrate(queryClient)}>
<SingleBlogPage id={params.id} />
{/* <SingleBlogPage id={params.id} /> */}
<div></div>
</HydrationBoundary>
)
}
+3 -3
View File
@@ -1,6 +1,6 @@
'use client'
import { Profile, Calendar } from 'iconsax-react'
import { NextPage } from 'next'
import { FC } from 'react'
import Image from 'next/image'
// import MostVisited from '../components/MostVisited'
import ContactUs from '../components/ContactUs'
@@ -12,7 +12,7 @@ type Props = {
id: string
}
const SingleBlog: NextPage<Props> = ({ id }) => {
const SingleBlogPage: FC<Props> = ({ id }) => {
const { data } = useGetBlogSingle(id)
if (!data) return <div></div>
@@ -99,4 +99,4 @@ const SingleBlog: NextPage<Props> = ({ id }) => {
)
}
export default SingleBlog
export default SingleBlogPage