import React, { useMemo } from 'react'; import Wrap from '../wrap/Wrap'; import { returnClass } from '../unit'; import '../g.scss'; function LabelNumberStyle(props: ILabelNumberStyle) { const { title = 'label', value = '', change, size = 'normal', list=[], paddingSize = 'normal', wrapStyle = { padding: '6px 20px 6px 20px' } } = props; const Dom = useMemo(() => { return (
{title}
{Array.isArray(list) && list?.length > 0 && list?.map((item) => { if (item.type === 'round') { return (
change?.(item?.key)} > {item?.value}
); } else { return (
change?.(item.key)} > {item?.value}
); } })}
); }, [title, value, paddingSize, list]); return Dom; } export default LabelNumberStyle; export interface ILabelNumberStyle { title?: any; value?: string; change?: Function; size?: string; list?: IList[]; paddingSize?: string; wrapStyle?: React.CSSProperties; } export interface IList { key: string; value?: string; type?: string; }