import { useQuery } from '@apollo/client' import Comment, { CommentSkeleton } from './comment' export default function Comments ({ comments, ...props }) { return comments.map(item => (
)) } export function CommentsSkeleton () { const comments = new Array(3).fill(null) return comments.map((_, i) => (
)) } export function CommentsQuery ({ query, ...props }) { const { loading, error, data } = useQuery(query) if (error) return
Failed to load!
if (loading) { return } return }