-
diff --git a/src/components/widgets/comment/Comments.tsx b/src/components/widgets/comment/Comments.tsx
index 4255d70f8c..6c7125610e 100644
--- a/src/components/widgets/comment/Comments.tsx
+++ b/src/components/widgets/comment/Comments.tsx
@@ -2,14 +2,13 @@
import { useInfiniteQuery } from '@tanstack/react-query'
import { memo, useMemo } from 'react'
-import { useInView } from 'react-intersection-observer'
import type { FC } from 'react'
import type { CommentBaseProps } from './types'
-import { Loading } from '~/components/ui/loading'
import { BottomToUpSoftScaleTransitionView } from '~/components/ui/transition/BottomToUpSoftScaleTransitionView'
import { apiClient } from '~/utils/request'
+import { LoadMoreIndicator } from '../shared/LoadMoreIndicator'
import { Comment } from './Comment'
import { CommentBoxProvider } from './CommentBox/providers'
import { CommentSkeleton } from './CommentSkeleton'
@@ -76,19 +75,3 @@ const CommentListItem: FC<{ comment: any; refId: string; index: number }> =
)
})
-
-const LoadMoreIndicator: FC<{
- onClick: () => void
-}> = ({ onClick }) => {
- const { ref } = useInView({
- rootMargin: '1px',
- onChange(inView) {
- if (inView) onClick()
- },
- })
- return (
-
-
-
- )
-}
diff --git a/src/components/widgets/shared/LoadMoreIndicator.tsx b/src/components/widgets/shared/LoadMoreIndicator.tsx
new file mode 100644
index 0000000000..7b3cb24eb0
--- /dev/null
+++ b/src/components/widgets/shared/LoadMoreIndicator.tsx
@@ -0,0 +1,22 @@
+'use client'
+
+import { useInView } from 'react-intersection-observer'
+import type { FC } from 'react'
+
+import { Loading } from '~/components/ui/loading'
+
+export const LoadMoreIndicator: FC<{
+ onClick: () => void
+}> = ({ onClick }) => {
+ const { ref } = useInView({
+ rootMargin: '1px',
+ onChange(inView) {
+ if (inView) onClick()
+ },
+ })
+ return (
+
+
+
+ )
+}