import React, { FC, useMemo } from 'react'; import { Comment } from '../Comment'; import { Filler } from '~/components/containers/Filler'; import * as styles from './styles.scss'; import { ICommentGroup, IComment } from '~/redux/types'; import { groupCommentsByUser } from '~/utils/fn'; interface IProps { comments?: IComment[]; } const NodeComments: FC = ({ comments }) => { const groupped: ICommentGroup[] = useMemo(() => comments.reduce(groupCommentsByUser, []), [ comments, ]); return (
{groupped.map(group => ( ))}
); }; export { NodeComments };