UNPKG

geoiq-frontend-ui-kit

Version:

This project is a UI kit for GeoIQ's frontend. It's built with React, TypeScript, and Vite.

27 lines (26 loc) 731 B
import l, { useState as a } from "react"; import { FormStructureContext as c } from "./index.es145.js"; const f = ({ children: n, structure: e }) => { const [t, o] = a(0), r = () => { t < e.steps.length - 1 && o(t + 1); }, p = () => { t > 0 && o(t - 1); }, S = (s) => { s >= 0 && s < e.steps.length && o(s); }, i = { structure: e, currentStepIndex: t, currentStep: e.steps[t], goToNextStep: r, goToPreviousStep: p, goToStep: S, isFirstStep: t === 0, isLastStep: t === e.steps.length - 1, totalSteps: e.steps.length }; return /* @__PURE__ */ l.createElement(c.Provider, { value: i }, n); }; export { f as FormStructureProvider }; //# sourceMappingURL=index.es128.js.map