import React from 'react';
import { Avatar, Icon } from 'antd';
import classNames from 'classnames';
import styles from './NoticeList.less';
export default function NoticeList({ data = [], onClick, onClear, title, locale }) {
if (data.length === 0) {
return (
{locale.emptyText}
);
}
return (
{data.map((item, i) => {
const itemCls = classNames(styles.item, {
[styles.read]: item.read,
});
return (
- onClick(item)}>
{item.avatar ?
: null}
{item.title}
{item.description}
{item.datetime}
{item.extra}
);
})}
{locale.clear}{title}
);
}