diff --git a/tone-page-web/app/(with-header-footer)/blog/[id]/components/BlogComments.tsx b/tone-page-web/app/(with-header-footer)/blog/[id]/components/BlogComments.tsx index 7fbc1bb..20f370d 100644 --- a/tone-page-web/app/(with-header-footer)/blog/[id]/components/BlogComments.tsx +++ b/tone-page-web/app/(with-header-footer)/blog/[id]/components/BlogComments.tsx @@ -3,13 +3,16 @@ import { BlogCommentTool } from "./BlogCommentTool"; import { BlogApi } from "@/lib/api"; import { BlogComment } from "@/lib/types/blogComment"; import { useState } from "react"; +import { useUserMe } from "@/hooks/user/use-user-me"; export function BlogComments({ blogId }: { blogId: string }) { - const { data, isLoading, error, mutate } = useSWR( + const { data, mutate } = useSWR( `/api/blog/${blogId}/comments`, () => BlogApi.getComments(blogId), ) + const { user } = useUserMe(); + const insertComment = async (newOne: BlogComment) => { await mutate( (comments) => { @@ -32,6 +35,13 @@ export function BlogComments({ blogId }: { blogId: string }) { replayTarget={replayTarget} handleClearReplayTarget={() => setReplayTarget(null)} /> + +