import React, { useMemo } from 'react'; import Wrap from '../wrap/Wrap'; import Icon from 'src/components/Icon/index'; import { returnClass } from '../unit'; import { Tooltip, Spin } from 'antd'; import '../g.scss'; function LabelIcon(props: ILabelIcon) { const { title = 'label', change, value, selectList = [], size = 'large', paddingSize = 'normal', wrapStyle = { padding: '6px 20px 6px 20px' } } = props; const Redio = useMemo(() => { return ( {title ? (
{title}
) : ( <> )}
{Array.isArray(selectList) && selectList?.length > 0 && selectList.map((item) => { return (
{ change?.(item?.key); }} style={{ cursor: 'pointer' }} />
); })}
); }, [title, value, paddingSize]); return Redio; } export default LabelIcon; export interface ILabelIcon { title?: any; value?: string | number; selectList?: any; change?: Function; size?: string; paddingSize?: string; wrapStyle?: React.CSSProperties; }