// ../src/helpers/formatClassString.ts
var formatClassString = (classesArray) => {
  return classesArray.filter((x) => !!x).join(" ");
};

// ../src/components/badge/badge.tsx
import { jsx } from "preact/jsx-runtime";
var Badge = ({ figure, forcePx, classNames, attributes }) => {
  const componentClassName = "ds-badge";
  let variant = "empty";
  if (figure) {
    variant = figure < 10 ? "single" : "double";
  }
  const classes = formatClassString([
    componentClassName,
    `${componentClassName}--${variant}`,
    forcePx && "ds-force-px",
    classNames
  ]);
  return /* @__PURE__ */ jsx("div", { className: classes, ...attributes, children: /* @__PURE__ */ jsx("span", { className: "ds-badge__inner", children: figure && (variant === "double" ? "9+" : figure) }) });
};
export {
  Badge
};
//# sourceMappingURL=badge.js.map
