UNPKG

@uva-glass/component-library

Version:

React components UvA

30 lines (29 loc) 1.37 kB
import { jsxs as s, jsx as n, Fragment as h } from "react/jsx-runtime"; import { useState as u, createElement as r } from "react"; import { c } from "../../clsx-OuTLNxxd.js"; import { s as t, T as a } from "../../TimelineItem-ClDZJkaZ.js"; import { Button as T } from "../Buttons/Button.js"; import "../Buttons/LinkButton.js"; import "@react-aria/button"; const y = ({ timelineData: l, showLabel: p, hideLabel: _ }) => { const [i, d] = u(!1), f = l.filter((e) => e.completed), m = l.filter((e) => !e.completed); return /* @__PURE__ */ s("div", { className: t.timeline__container, children: [ m.length > 0 && /* @__PURE__ */ n( "div", { className: c(t["timeline__button-container"], [ i && t["timeline__button-container--active"] ]), children: /* @__PURE__ */ n(T, { variant: "blank-subtle", onClick: () => d(!i), children: i ? `${_}` : `${p}` }) } ), /* @__PURE__ */ s("ul", { className: t.timeline__list, children: [ i ? /* @__PURE__ */ n(h, { children: m.map((e, o) => /* @__PURE__ */ r(a, { ...e, key: `${o}_${e.title}` })) }) : /* @__PURE__ */ n("li", { className: c(t.timeline__item, t["timeline__item--todo"]) }), f.map((e, o) => /* @__PURE__ */ r(a, { ...e, key: `${o}_${e.title}`, position: o })) ] }) ] }); }; export { y as Timeline }; //# sourceMappingURL=Timeline.js.map