123456789101112131415161718192021222324252627282930313233 |
- import React, { PureComponent } from 'react'
- import CommentItem, { CommentItemData } from './CommentItem';
- import { Divider } from 'antd';
- import styles from './CommentList.less';
-
- interface IP {
- list: Array<CommentItemData>;
- topDivider: boolean;
- onChangeListItem({ commentId, changeProp }: { commentId: string; changeProp: any; }): any;
- }
-
- interface IS {
-
- }
-
- export default class CommentList extends PureComponent<IP, IS> {
- render() {
- return (
- <div className={styles.wrapper}>
- {this.props.topDivider ? <Divider /> : null}
- {this.props.list.map((i, index) => {
- return (
- <>
- <CommentItem data={i} onChangeListItem={this.props.onChangeListItem} />
- {index === this.props.list.length - 1 ? null : <Divider />}
- </>
- )
- })}
- </div>
- )
- }
- }
|