import {IllustratedMessage} from '@common/ui/images/illustrated-message'; import {Trans} from '@common/i18n/trans'; import {InfiniteScrollSentinel} from '@common/ui/infinite-scroll/infinite-scroll-sentinel'; import {PageStatus} from '@common/http/page-status'; import React, {Fragment} from 'react'; import {useUserProfile} from '@app/profile/requests/use-user-profile'; import {RateReviewIcon} from '@common/icons/material/RateReview'; import {TitlePoster} from '@app/titles/title-poster/title-poster'; import {Title} from '@app/titles/models/title'; import {TitleLink, TitleLinkWithEpisodeNumber} from '@app/titles/title-link'; import {Episode} from '@app/titles/models/episode'; import {useProfileComments} from '@app/profile/requests/use-profile-comments'; import {Comment} from '@common/comments/comment'; import {ThumbUpIcon} from '@common/icons/material/ThumbUp'; import {FormattedRelativeTime} from '@common/i18n/formatted-relative-time'; export function ProfileCommentsPanel() { const userQuery = useUserProfile(); const user = userQuery.data!.user; const commentsQuery = useProfileComments(); if (commentsQuery.noResults) { return ( } size="sm" title={} description={ } /> ); } if (commentsQuery.data) { return ( {commentsQuery.items.map(comment => ( ))} ); } return ; } interface CommentListItemProps { comment: Comment; } function CommentListItem({comment}: CommentListItemProps) { const commentable = comment.commentable as Title | Episode; const title = commentable.model_type === 'episode' ? commentable.title! : commentable; return (
{commentable.model_type === 'episode' ? ( ) : ( )}

{comment.content}

{comment.upvotes ? (
{comment.upvotes}
) : null}
); }