import useSWR from "swr"; import { BlogCommentTool } from "./BlogCommentTool"; import { BlogApi } from "@/lib/api"; export function BlogComments({ blogId }: { blogId: string }) { const { data, isLoading, error } = useSWR( `/api/blog/${blogId}/comments`, () => BlogApi.getComments(blogId), ) return ( data &&
{new Date(d.createdAt).toLocaleString()}
未知
回复
{new Date().toLocaleString()}
未知