import { List } from "antd"; import DiscussionItem, { type IComment } from "./DiscussionItem"; interface IWidget { data: IComment[]; onSelect?: Function; onDelete?: Function; onReply?: Function; onClose?: Function; } const DiscussionListWidget = ({ data, onSelect, onDelete, onReply, onClose, }: IWidget) => { return ( { console.log(page); }, pageSize: 10, }} itemLayout="horizontal" dataSource={data} renderItem={(item) => ( , data: IComment ) => { if (typeof onSelect !== "undefined") { onSelect(e, data); } }} onDelete={() => { if (typeof onDelete !== "undefined") { onDelete(item.id); } }} onReply={() => { if (typeof onReply !== "undefined") { onReply(item); } }} onClose={() => { if (typeof onClose !== "undefined") { onClose(item); } }} /> )} /> ); }; export default DiscussionListWidget;