import React from 'react';
import { array, string } from 'prop-types';
import { Tooltip, List, Badge } from 'antd';
import { InfoCircleOutlined } from '@ant-design/icons';
const { Item } = List;
const style = { paddingTop: 4, paddingBottom: 4}
TooltipList.propTypes = {
data: array.isRequired,
title: string
};
function TooltipList(props) {
const { data = [], title = '' } = props;
return (
<Tooltip
title={
<List
header={`${title}说明:`}
dataSource={data}
size="small"
className="tips-title"
split={false}
renderItem={item => (
<Item style={style}>
<Badge color="#fff" />
{item}
</Item>
)}
/>
}
>
<InfoCircleOutlined />
</Tooltip>
);
}
export default React.memo(TooltipList);