import type { FindWaterfallBlogPostQuery, FindWaterfallBlogPostQueryVariables, } from 'types/graphql' import type { CellSuccessProps, CellFailureProps, TypedDocumentNode, } from '@cedarjs/web' import AuthorCell from 'src/components/AuthorCell' export const QUERY: TypedDocumentNode< FindWaterfallBlogPostQuery, FindWaterfallBlogPostQueryVariables > = gql` query FindWaterfallBlogPostQuery($id: Int!) { waterfallBlogPost: post(id: $id) { id title body authorId createdAt } } ` export const Loading = () =>
Loading...
export const Empty = () =>
Empty
export const Failure = ({ error, }: CellFailureProps) => (
Error: {error?.message}
) export const Success = ({ waterfallBlogPost, }: CellSuccessProps< FindWaterfallBlogPostQuery, FindWaterfallBlogPostQueryVariables >) => (
{waterfallBlogPost && ( <>

{new Intl.DateTimeFormat('en-US', { year: 'numeric', month: 'long', day: 'numeric', }).format(new Date(waterfallBlogPost.createdAt))}{' '} - By:

{waterfallBlogPost.title}

{waterfallBlogPost.body}
)}
)