mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-05-28 00:58:20 +08:00

Co-authored-by: NFish <douxc512@gmail.com> Co-authored-by: zxhlyh <jasonapring2015@outlook.com> Co-authored-by: twwu <twwu@dify.ai> Co-authored-by: jZonG <jzongcode@gmail.com>
28 lines
694 B
TypeScript
28 lines
694 B
TypeScript
import { type FC, Fragment } from 'react'
|
|
import type { Step } from './step'
|
|
import { StepperStep } from './step'
|
|
|
|
export type StepperProps = {
|
|
steps: Step[]
|
|
activeIndex: number
|
|
}
|
|
|
|
export const Stepper: FC<StepperProps> = (props) => {
|
|
const { steps, activeIndex } = props
|
|
return <div className='flex items-center gap-3'>
|
|
{steps.map((step, index) => {
|
|
const isLast = index === steps.length - 1
|
|
return (
|
|
<Fragment key={index}>
|
|
<StepperStep
|
|
{...step}
|
|
activeIndex={activeIndex}
|
|
index={index}
|
|
/>
|
|
{!isLast && <div className='h-px w-4 bg-divider-deep' />}
|
|
</Fragment>
|
|
)
|
|
})}
|
|
</div>
|
|
}
|