"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useStepper = void 0;
const react_1 = require("react");
const useStepper = ({ defaultStep = 0, maxSteps = 2 }) => {
    const [step, setStep] = (0, react_1.useState)(defaultStep);
    const handleNext = () => {
        if (maxSteps && step >= maxSteps - 1) {
            return;
        }
        setStep((prev) => prev + 1);
    };
    const handlePrevious = () => {
        if (step <= 0) {
            return;
        }
        setStep((prev) => prev - 1);
    };
    return {
        step,
        setStep,
        handleNext,
        handlePrevious
    };
};
exports.useStepper = useStepper;
