import React, { ReactNode } from 'react'; import useNewToken from '@/Hook/useNewToken'; import style from './index.less' import { CheckOutlined } from '@ant-design/icons'; export type NewStepsItem = { title: ReactNode description?: ReactNode children?: NewStepsItem[] checked?: boolean isLeaf?: boolean id?: string onChange?: (item: NewStepsItem) => void } interface NewStepsProps { items: NewStepsItem[] isLeaf?: boolean onChange?: (item: NewStepsItem, falterItem?: NewStepsItem) => void } /** * 自定义步骤条 * @param param0 * @returns */ const NewSteps: React.FC = ({ items = [], onChange, isLeaf }) => { /***************************************/ const { token } = useNewToken() /***************************************/ return
{items.map((i, index) =>
{i.checked ? : index + 1}
{ e.stopPropagation() onChange?.(i) }} >
{i.title}
{i?.description &&
{i.description}
}
{i.children &&
onChange?.(e, f)} isLeaf={true} />
}
)}
; }; export default React.memo(NewSteps);