"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useLogic = void 0;
const useLogic = ({ steps, activeStep = 0, onClickPrevStep, }) => {
    const clickableSteps = onClickPrevStep ? steps.slice(0, activeStep) : [];
    const normalSteps = onClickPrevStep ? steps.slice(activeStep) : steps;
    const getStepLabelProps = (index) => {
        const isSelected = activeStep === index;
        return {
            isSelected,
        };
    };
    const getStepButtonProps = (index) => {
        const isSelected = activeStep === index;
        const handleClick = () => onClickPrevStep?.(index);
        return {
            isSelected,
            onClick: handleClick,
        };
    };
    return {
        clickableSteps,
        normalSteps,
        getStepLabelProps,
        getStepButtonProps,
    };
};
exports.useLogic = useLogic;
