// ../src/components/teaser-footer/teaser-footer.tsx
import { Fragment } from "preact/jsx-runtime";

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

// ../src/foundations/icons/sprite.svg
import { h } from "preact";
import { jsx, jsxs } from "preact/jsx-runtime";

// ../src/components/icon-sprite/icon-sprite.tsx
import { jsx as jsx2 } from "preact/jsx-runtime";
var IconUse = ({ iconName, classNames, attributes }) => {
  const componentClassName = "ds-icon";
  const classes = formatClassString([
    componentClassName,
    `${componentClassName}--sprite`,
    `${componentClassName}--${iconName}`,
    classNames
  ]);
  return /* @__PURE__ */ jsx2("i", { className: classes, ...attributes, children: /* @__PURE__ */ jsx2("svg", { children: /* @__PURE__ */ jsx2("use", { xlinkHref: `#ds-${iconName}` }) }) });
};

// ../src/components/teaser-footer/teaser-footer.tsx
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs2 } from "preact/jsx-runtime";
var TeaserFooter = (props) => {
  const { footerVariant, attributes = {}, classNames = "" } = props;
  const componentClassName = "ds-teaser-footer";
  const classes = formatClassString([componentClassName, `${componentClassName}--${footerVariant}`, classNames]);
  return footerVariant !== "default" ? /* @__PURE__ */ jsxs2("div", { className: classes, ...attributes, children: [
    footerVariant === "informationText" && /* @__PURE__ */ jsx3(InformationText, { ...props }),
    footerVariant === "podcast" && /* @__PURE__ */ jsxs2(Fragment2, { children: [
      /* @__PURE__ */ jsx3(IconUse, { iconName: "play_arrow-filled" }),
      /* @__PURE__ */ jsxs2("div", { children: [
        /* @__PURE__ */ jsx3("span", { className: `${componentClassName}__title`, children: "Lyssna p\xE5 avsnittet" }),
        /* @__PURE__ */ jsx3(InformationText, { ...props })
      ] })
    ] })
  ] }) : null;
};
function InformationText({ duration, publicationTime, sectionName }) {
  const strings = [duration, publicationTime, sectionName].filter(Boolean);
  if (strings.length === 0) {
    return null;
  }
  return /* @__PURE__ */ jsx3("div", { className: "ds-teaser-footer__notes", children: strings.map((text, index) => /* @__PURE__ */ jsxs2(Fragment, { children: [
    text,
    index < strings.length - 1 && " \u2022 "
  ] }, index)) });
}
export {
  TeaserFooter
};
//# sourceMappingURL=teaser-footer.js.map
