import { BeerCommentQueryResultT } from '@/services/BeerComment/schema/BeerCommentQueryResult'; import { formatDistanceStrict } from 'date-fns'; import { useEffect, useState } from 'react'; import { Rating } from 'react-daisyui'; const CommentCard: React.FC<{ comment: BeerCommentQueryResultT; }> = ({ comment }) => { const [timeDistance, setTimeDistance] = useState(''); useEffect(() => { setTimeDistance(formatDistanceStrict(new Date(comment.createdAt), new Date())); }, [comment.createdAt]); return (

{comment.postedBy.username}

posted {timeDistance} ago

{Array.from({ length: 5 }).map((val, index) => ( ))}

{comment.content}

); }; export default CommentCard;