import React from 'react'; import { useIntl } from '@umijs/max'; import { Divider } from 'antd'; interface InfoColumnProps { fieldList: { label: string; key: string; locale?: boolean; render?: (val: any, data: any) => any; }[]; style?: React.CSSProperties; data: Record; } const InfoColumn: React.FC = (props) => { const { data, fieldList, style } = props; const intl = useIntl(); return ( {fieldList.map((item, index) => { return ( {' '} {item.locale ? intl.formatMessage({ id: item.label }) : item.label} {' '} {item.render?.(data[item.key], data) ?? data[item.key]} {index < fieldList.length - 1 ? ( ) : null} ); })} ); }; export default InfoColumn;