import React from 'react'; import { View, Text } from '@tarojs/components'; import './index.scss'; interface Step { label: string; } interface StepIndicatorProps { steps: Step[]; current: number; onChange?: (index: number) => void; } export default React.memo(function StepIndicator({ steps, current, onChange }: StepIndicatorProps) { return ( {steps.map((step, idx) => { const isCurrent = idx === current; const isDone = idx < current; const isClickable = isDone && !!onChange; return ( {idx > 0 && ( )} onChange(idx) : undefined} > {isDone ? : {idx + 1}} {step.label} ); })} ); });