diff --git a/web/app/components/datasets/create/stepper/index.tsx b/web/app/components/datasets/create/stepper/index.tsx index 4c120e4d48..30cf9bd0e4 100644 --- a/web/app/components/datasets/create/stepper/index.tsx +++ b/web/app/components/datasets/create/stepper/index.tsx @@ -1,4 +1,4 @@ -import type { FC } from 'react' +import { type FC, Fragment } from 'react' import type { Step } from './step' import { StepperStep } from './step' @@ -7,28 +7,21 @@ export type StepperProps = { activeIndex: number } -function join(array: T[], sep: R): Array { - return array.reduce((acc, item, index) => { - if (index === 0) - return [item] - - return acc.concat([sep, item]) - }, [] as Array) -} - export const Stepper: FC = (props) => { const { steps, activeIndex } = props return
- {join( - steps.map((step, index) => ( - - )), -
, - )} + {steps.map((step, index) => { + const isLast = index === steps.length - 1 + return ( + + + {!isLast &&
} + + ) + })}
}