@anoki/fse-ui
Version:
FSE UI components library
64 lines (63 loc) • 2.45 kB
JavaScript
import { j as e } from "./index.es278.js";
import { Image as h } from "./index.es388.js";
import { ArrowLink as _ } from "./index.es21.js";
import { SectionHeading as x } from "./index.es229.js";
import './components/ui/CardPreview/CardPreview.css';/* empty css */
import { RichText as p } from "./index.es218.js";
var j = /* @__PURE__ */ ((s) => (s.WITH_TOPIC_DATE = "withTopicDate", s.NO_TOPIC_DATE = "noTopicDate", s))(j || {});
const D = ({
variant: s = "withTopicDate",
sectionTitle: o = "",
imageUrl: n,
title: r,
description: d,
link: i,
asLink: t,
date: a,
topic: c
}) => {
const m = t ?? "a", l = typeof r == "string" ? `${i.title} - ${r}` : i.title;
return /* @__PURE__ */ e.jsxs("section", { className: "card-preview-section", children: [
/* @__PURE__ */ e.jsx(
x,
{
title: o,
className: "card-preview-section-title"
}
),
/* @__PURE__ */ e.jsxs("div", { className: "news-card", children: [
/* @__PURE__ */ e.jsx("div", { className: "news-card__image", children: n ? /* @__PURE__ */ e.jsx("img", { src: n, alt: "Anteprima" }) : /* @__PURE__ */ e.jsx("div", { className: "placeholder-icon", children: /* @__PURE__ */ e.jsx(h, { width: 20, height: 20 }) }) }),
s === "withTopicDate" && (c || a) && /* @__PURE__ */ e.jsxs("div", { className: "news-card__info", children: [
/* @__PURE__ */ e.jsx("div", { className: "news-card__info__topic", children: c || "" }),
/* @__PURE__ */ e.jsx("div", { className: "news-card__info__date", children: a || "" })
] }),
/* @__PURE__ */ e.jsxs("div", { className: "news-card__content", children: [
/* @__PURE__ */ e.jsx("h3", { className: "news-card__title cursor-pointer hover-underline", children: /* @__PURE__ */ e.jsx(
m,
{
className: "link-unstyled",
href: i.link,
"aria-label": l,
children: r
}
) }),
/* @__PURE__ */ e.jsx("div", { className: "news-card__description", children: /* @__PURE__ */ e.jsx(p, { description: d }) }),
/* @__PURE__ */ e.jsx(
_,
{
className: "news-card__cta",
href: i.link,
asLink: t,
"aria-label": l,
children: i.title
}
)
] })
] })
] });
};
export {
D as CardPreview,
j as CardPreviewVariant
};
//# sourceMappingURL=index.es58.js.map