import { CheckIcon } from "@chakra-ui/icons"; import { Box, Circle, Flex, Icon, Text, Tooltip, useBreakpointValue, useColorModeValue } from "@chakra-ui/react"; import React from "react"; import { URMLogo } from "./Icon/Icon"; interface Step { id: string; label: string; stepNumber: number; } interface StepperProps { steps: Step[]; currentStep: number; maxCompletedStep?: number; onStepClick: (stepNumber: number) => void; onClose?: () => void; } const CloseXIcon: React.FC = () => ( ); const Stepper: React.FC = ({ steps, currentStep, onStepClick, onClose }) => { const bgColor = useColorModeValue("white", "gray.800"); const borderColor = useColorModeValue("gray.200", "gray.700"); const textColor = useColorModeValue("gray.700", "gray.200"); const mutedColor = useColorModeValue("gray.400", "gray.500"); const activeColor = "#475BB2"; const lineColor = useColorModeValue("gray.300", "gray.600"); const closeIconColor = "#909090"; const showLabels = useBreakpointValue({ base: false, md: false, lg: true }); const circleSize = useBreakpointValue({ base: "24px", md: "28px" }); const isStepCompleted = (stepNumber: number) => stepNumber < currentStep; const isStepCurrent = (stepNumber: number) => stepNumber === currentStep; const isStepClickable = (stepNumber: number) => stepNumber <= currentStep + 1 && stepNumber <= steps.length; return ( {/* Logo - Far Left - Hidden on mobile and tablet */} {steps.map((step, index) => ( { if ( isStepClickable(step.stepNumber) ) { onStepClick(step.stepNumber); } }} opacity={ isStepClickable(step.stepNumber) ? 1 : 0.6 } _hover={ isStepClickable(step.stepNumber) ? { opacity: 0.8 } : undefined } role="button" aria-label={`Go to ${step.label}`} tabIndex={ isStepClickable(step.stepNumber) ? 0 : -1 } flexShrink={0} > {isStepCompleted( step.stepNumber ) ? ( ) : ( {step.stepNumber} )} {/* Show labels only on larger screens */} {showLabels && ( {step.label} )} {/* Connector line - stretches to fill space */} {index < steps.length - 1 && ( )} ))} {onClose && ( )} ); }; export default Stepper;