Files
remark42/frontend/app/components/list-comments/list-comments.tsx
T
2021-08-08 14:25:10 -05:00

35 lines
776 B
TypeScript

import { h } from 'preact';
import { useIntl } from 'react-intl';
import clsx from 'clsx';
import type { Comment as CommentType } from 'common/types';
import { Comment } from 'components/comment';
import styles from './list-comments.module.css';
type Props = {
comments: CommentType[];
};
export function ListComments({ comments = [] }: Props) {
const intl = useIntl();
return (
<div className={clsx('comments-list', styles.root)}>
{comments.map((comment) => (
<Comment
intl={intl}
key={comment.id}
data={comment}
level={0}
view="preview"
mix="list-comments__item"
user={null}
theme="light"
isCommentsDisabled={false}
/>
))}
</div>
);
}