@payfit/unity-components
Version:
21 lines (20 loc) • 606 B
JavaScript
import { createContext as e, useContext as t } from "react";
import { jsx as n } from "react/jsx-runtime";
//#region src/components/timeline/Timeline.context.tsx
var r = e(null);
function i({ children: e, orientation: t, type: i }) {
return /* @__PURE__ */ n(r.Provider, {
value: {
orientation: t,
type: i
},
children: e
});
}
function a() {
let e = t(r);
if (!e) throw Error("useTimelineContext must be used within a Timeline component. Make sure to wrap your TimelineStep components with <Timeline>.");
return e;
}
//#endregion
export { i as TimelineProvider, a as useTimelineContext };