geoiq-frontend-ui-kit
Version:
This project is a UI kit for GeoIQ's frontend. It's built with React, TypeScript, and Vite.
59 lines (58 loc) • 1.48 kB
JavaScript
import e from "react";
import { Button as a } from "./index.es7.js";
import { useFormStructure as x } from "./index.es145.js";
import { useFormValues as F } from "./index.es146.js";
const E = ({
onGoToNextStep: i,
onGoToPreviousStep: n,
isSubmitting: p,
testMode: o = !1
}) => {
const {
goToNextStep: u,
goToPreviousStep: d,
isFirstStep: t,
isLastStep: r,
currentStep: S,
currentStepIndex: l,
totalSteps: s
} = x(), { submitForm: f, validateStep: v, values: c } = F(), { isStepValid: m } = v(S), b = () => {
i && i({
currentStepIndex: l,
totalSteps: s,
isFirstStep: t,
isLastStep: r,
values: c
}), u();
}, g = () => {
n && n({
currentStepIndex: l,
totalSteps: s,
isFirstStep: t,
isLastStep: r,
values: c
}), d();
};
return /* @__PURE__ */ e.createElement("div", { className: "w-full flex h-[5rem] items-center justify-center gap-3 border-t border-neutral-1 bg-light-2 px-3" }, /* @__PURE__ */ e.createElement(a, { variant: "secondary", onClick: g }, t ? "Cancel" : "Back"), r ? /* @__PURE__ */ e.createElement(
a,
{
variant: "primary",
onClick: f,
disabled: !(m || o),
loading: p
},
"Submit"
) : /* @__PURE__ */ e.createElement(
a,
{
variant: "primary",
onClick: b,
disabled: !(m || o)
},
"Save & Next"
));
};
export {
E as FormNavigation
};
//# sourceMappingURL=index.es126.js.map