UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

54 lines (53 loc) 1.74 kB
import { jsx as n, Fragment as a, jsxs as r } from "react/jsx-runtime"; import l from "../IconSvg/IconSvg.js"; import { NavActionEnum as c } from "./types.js"; function m(t) { const o = ((e) => e.isWizardMode ? e.previousStepIds && e.previousStepIds.length > 0 : e.steps.findIndex((s) => s.id === e.currentStep.id) > 0)(t) ? /* @__PURE__ */ n( "button", { type: "button", onClick: (e) => t.onNavAction(c.PREVIOUS), className: "btn btn-link nav-link prev", children: /* @__PURE__ */ n(l, { icon: "chevronLeft" }) } ) : /* @__PURE__ */ n(a, {}), u = t.currentStep.final ? /* @__PURE__ */ n(a, {}) : /* @__PURE__ */ n( "button", { type: "button", onClick: (e) => t.onNavAction(c.NEXT), className: "btn btn-link nav-link next", children: /* @__PURE__ */ n(l, { icon: "chevronRight" }) } ), d = /* @__PURE__ */ n( "button", { type: "button", className: "btn btn-action save", disabled: t.isFormSubmitted, onClick: (e) => t.onNavAction(c.SAVE), children: "SAVE" } ); return /* @__PURE__ */ r("div", { children: [ /* @__PURE__ */ n("hr", {}), /* @__PURE__ */ r("div", { className: "buttonWrapper pull-right", children: [ o, " ", u, " ", d ] }) ] }); } function f(t) { const i = t.steps.find((o) => o.id === t.nextStepId); return typeof i > "u" ? /* @__PURE__ */ n(a, {}) : /* @__PURE__ */ r("span", { className: "nav-link", children: [ /* @__PURE__ */ n("a", { onClick: (o) => t.onNavAction(i), children: i.title }), /* @__PURE__ */ n(l, { icon: "chevronRight" }) ] }); } export { m as NavButtons, f as NextStepLink }; //# sourceMappingURL=NavButtons.js.map