dify/web/app/components/datasets/create/stepper/step.tsx
Stephen Zhou a84c2d36a3
style: format with vp fmt (#38803)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-12 15:57:46 +00:00

58 lines
1.5 KiB
TypeScript

import type { FC } from 'react'
import { cn } from '@langgenius/dify-ui/cn'
export type Step = {
name: string
}
export type StepperStepProps = Step & {
index: number
activeIndex: number
}
export const StepperStep: FC<StepperStepProps> = (props) => {
const { name, activeIndex, index } = props
const isActive = index === activeIndex
const isDisabled = activeIndex < index
const label = isActive ? `STEP ${index + 1}` : `${index + 1}`
return (
<div className="flex items-center gap-2">
<div
className={cn(
'inline-flex h-5 flex-col items-center justify-center gap-2 rounded-3xl py-1',
isActive
? 'bg-state-accent-solid px-2'
: !isDisabled
? 'w-5 border border-text-quaternary'
: 'w-5 border border-divider-deep',
)}
>
<div
className={cn(
'text-center system-2xs-semibold-uppercase',
isActive
? 'text-text-primary-on-surface'
: !isDisabled
? 'text-text-tertiary'
: 'text-text-quaternary',
)}
>
{label}
</div>
</div>
<div
className={cn(
'system-xs-medium-uppercase',
isActive
? 'system-xs-semibold-uppercase text-text-accent'
: !isDisabled
? 'text-text-tertiary'
: 'text-text-quaternary',
)}
>
{name}
</div>
</div>
)
}