@popmenu/table 0.102.2 → 0.104.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.es.js CHANGED
@@ -2453,10 +2453,23 @@ var severityIcons$1 = {
2453
2453
  warning: SvgWarning,
2454
2454
  success: SvgCheckCircle,
2455
2455
  };
2456
+ var getLinkProps = function (link) {
2457
+ if (!link)
2458
+ return null;
2459
+ var href = link.href, onClick = link.onClick, text = link.text;
2460
+ if (!text)
2461
+ return null;
2462
+ var props = { children: text };
2463
+ if (href)
2464
+ return __assign$1(__assign$1({}, props), { href: href });
2465
+ if (onClick)
2466
+ return __assign$1(__assign$1({}, props), { onClick: onClick });
2467
+ return null;
2468
+ };
2456
2469
  var Alert = forwardRef(function (props, ref) {
2457
2470
  var children = props.children, link = props.link, _a = props.severity, severity = _a === void 0 ? 'error' : _a, _b = props.variant, variant = _b === void 0 ? 'outlined' : _b, onClose = props.onClose, muiProps = __rest$1(props, ["children", "link", "severity", "variant", "onClose"]);
2458
2471
  var classes = useAlertStyles(props);
2459
- var validLink = link && link.href && link.text && { href: link.href, children: link.text };
2472
+ var validLink = link && getLinkProps(link);
2460
2473
  var Action = (React__default.createElement(React__default.Fragment, null,
2461
2474
  validLink && React__default.createElement(Link, __assign$1({}, validLink)),
2462
2475
  onClose && (React__default.createElement(IconButton, { onClick: onClose },