import { Comment } from 'common/comment' import { Contract } from 'common/contract' import { contractPath } from 'web/lib/firebase/contracts' import { SiteLink } from './site-link' import { Row } from './layout/row' import { Avatar } from './avatar' import { RelativeTimestamp } from './relative-timestamp' import { UserLink } from './user-page' import { User } from 'common/user' import { Col } from './layout/col' import { groupBy } from 'lodash' import { Content } from './editor' export function UserCommentsList(props: { user: User comments: Comment[] contractsById: { [id: string]: Contract } }) { const { comments, contractsById } = props // we don't show comments in groups here atm, just comments on contracts const contractComments = comments.filter((c) => c.contractId) const commentsByContract = groupBy(contractComments, 'contractId') return ( {Object.entries(commentsByContract).map(([contractId, comments]) => { const contract = contractsById[contractId] return (
{contract.question} {comments.map((comment) => ( ))}
) })} ) } function ProfileComment(props: { comment: Comment; className?: string }) { const { comment, className } = props const { text, content, userUsername, userName, userAvatarUrl, createdTime } = comment // TODO: find and attach relevant bets by comment betId at some point return (

{' '}

) }