UNPKG

omnipay-savings-sdk

Version:

Omnipay Savings SDK

22 lines (21 loc) 1.03 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const jsx_runtime_1 = require("react/jsx-runtime"); const LockedSavingsForm_1 = __importDefault(require("./LockedSavingsForm")); const FlexibleSavingsForm_1 = __importDefault(require("./FlexibleSavingsForm")); const OtherSavingsForm = (props) => { const { savingsOption } = props; // Check if this is a locked savings category const isLockedCategory = (savingsOption === null || savingsOption === void 0 ? void 0 : savingsOption.isLocked) || false; // Route to the appropriate form component based on savings type if (isLockedCategory) { return (0, jsx_runtime_1.jsx)(LockedSavingsForm_1.default, Object.assign({}, props)); } else { return (0, jsx_runtime_1.jsx)(FlexibleSavingsForm_1.default, Object.assign({}, props)); } }; exports.default = OtherSavingsForm;