/*
 * @Author: cclu
 * @Date: 2021-12-13 11:01:23
 * @LastEditTime: 2022-04-29 14:51:33
 * @LastEditors: Please set LastEditors
 * @Description:  描述类组件 可用 内置的ant description.Item 替代
 * @FilePath: \cloud-platform\src\pages\DataVerification\components\DescriptionItem.tsx
 */

import '../style.less'
import numeral from 'numeral'


function getContent(content: number|string) {
    
   // eslint-disable-next-line no-restricted-globals
   return isNaN(content) ? content : numeral(content).format('0,0.00')
}
/**
 * @description: 拼接标题：内容 格式字符串
 * @param {object} param1
 * @return {*}
 */
const DescriptionItem = ({ title, content }: { title: string, content: number|string|undefined }) => (
    <div className="site-description-item-profile-wrapper">
        <p className="site-description-item-profile-p-label">{title}:</p>
       
        {content ?
            getContent(content)
            : '-'
        }
    </div>
);

export default DescriptionItem;

