diff --git a/src/components/common/Comment.tsx b/src/components/common/Comment.tsx index bcf525be..94601a48 100644 --- a/src/components/common/Comment.tsx +++ b/src/components/common/Comment.tsx @@ -9,7 +9,7 @@ import { ExpandedNote } from "~/lib/types" import { cn } from "~/lib/utils" import { useGetComments } from "~/queries/page" -export const Comment = ({ +const Comment = ({ page, className, }: { @@ -90,3 +90,5 @@ const Loader = () => { ) } + +export default Comment diff --git a/src/components/site/PostFooter.tsx b/src/components/site/PostFooter.tsx index c8658d88..07cbc522 100644 --- a/src/components/site/PostFooter.tsx +++ b/src/components/site/PostFooter.tsx @@ -1,13 +1,14 @@ "use client" import { useInViewport } from "ahooks" +import dynamic from "next/dynamic" import { useEffect, useRef } from "react" import { useQuery, useQueryClient } from "@tanstack/react-query" -import { Comment } from "~/components/common/Comment" import { ReactionLike } from "~/components/common/ReactionLike" import { ReactionTip } from "~/components/common/ReactionTip" +import { useTranslation } from "~/lib/i18n/client" import { ExpandedCharacter, ExpandedNote } from "~/lib/types" const key = ["PostFooterInView"] @@ -34,6 +35,12 @@ export const PostFooter = ({ queryClient.setQueryData(key, () => isInView) }, [isInView]) + const { t } = useTranslation("common") + + const DynamicComment = dynamic(() => import("~/components/common/Comment"), { + loading: () =>
{t("Loading comments")}...
, + }) + return ( <> -