@razorpay/blade
Version:
The Design System that powers Razorpay
54 lines (51 loc) • 3.04 kB
JavaScript
import _defineProperty from '@babel/runtime/helpers/defineProperty';
import '../Button/index.js';
import '../Box/index.js';
import '../Typography/index.js';
import { jsxs, jsx } from 'react/jsx-runtime';
import { Box } from '../Box/Box.js';
import { Text } from '../Typography/Text/Text.js';
import Button from '../Button/Button/Button.js';
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var SpotlightPopoverTourFooter = function SpotlightPopoverTourFooter(_ref) {
var activeStep = _ref.activeStep,
totalSteps = _ref.totalSteps,
actions = _ref.actions;
var hasPrimaryAction = Boolean(actions === null || actions === void 0 ? void 0 : actions.primary);
var hasSecondaryAction = Boolean(actions === null || actions === void 0 ? void 0 : actions.secondary);
var isBothIcon = false;
if (hasPrimaryAction && hasSecondaryAction) {
var _actions$primary, _actions$secondary;
var primaryHasIcon = Boolean(actions === null || actions === void 0 ? void 0 : (_actions$primary = actions.primary) === null || _actions$primary === void 0 ? void 0 : _actions$primary.icon);
var secondaryHasIcon = Boolean(actions === null || actions === void 0 ? void 0 : (_actions$secondary = actions.secondary) === null || _actions$secondary === void 0 ? void 0 : _actions$secondary.icon);
isBothIcon = primaryHasIcon && secondaryHasIcon;
}
return /*#__PURE__*/jsxs(Box, {
display: "flex",
justifyContent: "space-between",
alignItems: "center",
gap: "spacing.7",
children: [/*#__PURE__*/jsxs(Text, {
size: "small",
weight: "semibold",
children: [activeStep + 1, " / ", totalSteps]
}), /*#__PURE__*/jsxs(Box, {
display: "flex",
gap: isBothIcon ? 'spacing.3' : 'spacing.4',
children: [hasSecondaryAction ? /*#__PURE__*/jsx(Button, _objectSpread(_objectSpread({
size: "small",
variant: "secondary"
}, actions.secondary), {}, {
children: actions === null || actions === void 0 ? void 0 : actions.secondary.text
})) : null, hasPrimaryAction ? /*#__PURE__*/jsx(Button, _objectSpread(_objectSpread({
size: "small",
variant: "primary"
}, actions.primary), {}, {
children: actions === null || actions === void 0 ? void 0 : actions.primary.text
})) : null]
})]
});
};
export { SpotlightPopoverTourFooter };
//# sourceMappingURL=TourFooter.web.js.map