import { Divider, Space, Steps } from 'antd'; import { useMemo } from 'react'; import { useIntl } from 'umi'; import { v4 } from 'uuid'; import { formatUserRender } from '../utils'; const { Step } = Steps; export interface DetailStepProps { list: API.User[][]; newStep?: any[]; } const DetailStep = (props: DetailStepProps) => { const { list, newStep } = props; const resultList = useMemo(() => { return list.map((item) => item.map((element) => ({ ...element, key: v4() }))); }, [list]); const { formatMessage } = useIntl(); const stepNodeTitle = (index: number) => { if (!newStep) return undefined; const step = newStep[index - 1]; if (step?.nodeType === 2) { return formatMessage({ id: 'component.AduitPreview.steps.noticeNode' }); } return undefined; }; return ( <> 3 ? 'vertical' : 'horizontal'} progressDot current={list?.length} size={'small'} > {resultList?.map((item, index) => ( 3 ? 'horizontal' : 'vertical'} split={ list?.length > 3 ? : '' } > {item?.map?.((val) => ( {val.id ? formatUserRender({ id: val.id, account: val?.nameEn, nameZh: val.nameZh, state: val.state, }) : val.nameZh} ))} } /> ))} ); }; export default DetailStep;