fix: preview page error
This commit is contained in:
parent
6dfc652fbf
commit
85572fed13
|
|
@ -4,7 +4,7 @@ import { useTranslations } from "next-intl"
|
|||
import dynamic from "next/dynamic"
|
||||
import { useParams } from "next/navigation"
|
||||
|
||||
import PostTitle from "~/components/site/PostTitle"
|
||||
import PostTitle from "~/components/site/PostTitle.client"
|
||||
import { useGetPage } from "~/queries/page"
|
||||
import { useGetSite } from "~/queries/site"
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
import { useTranslations } from "next-intl"
|
||||
|
||||
import { cn } from "~/lib/utils"
|
||||
|
||||
export default function PostTitle({
|
||||
icon,
|
||||
title,
|
||||
className,
|
||||
center,
|
||||
skipTranslate,
|
||||
}: {
|
||||
icon?: React.ReactNode
|
||||
title?: string
|
||||
className?: string
|
||||
center?: boolean
|
||||
skipTranslate?: boolean
|
||||
}) {
|
||||
const t = useTranslations()
|
||||
|
||||
return (
|
||||
<h2
|
||||
className={cn(
|
||||
"xlog-post-title mb-8 flex items-center relative text-4xl font-extrabold",
|
||||
{
|
||||
"justify-center": center,
|
||||
"text-center": center,
|
||||
},
|
||||
className,
|
||||
)}
|
||||
>
|
||||
{icon}
|
||||
<span>{skipTranslate ? title : t(title)}</span>
|
||||
</h2>
|
||||
)
|
||||
}
|
||||
Loading…
Reference in New Issue