import React from 'react';
import styles from './index.less';
import { LinkProps } from '../detailInterface';

export default function Detail(props: LinkProps) {
    const { value, formatter } = props;
    const formatValue = formatter ? formatter(value) : value;
    if (!formatValue) return null;

    if (typeof formatValue === 'string') {
        return <div className={styles.text}>{formatValue}</div>;
    } else {
        return '数据错误';
    }
}
