UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

34 lines (33 loc) 971 B
import { jsxs as a, jsx as n } from "react/jsx-runtime"; import { useState as s } from "react"; import c from "../IconSvg/IconSvg.js"; function p({ title: t, content: o }) { const [e, d] = s(!1); return /* @__PURE__ */ a("div", { className: "ExpandableContent", children: [ /* @__PURE__ */ n("div", { className: "ExpandableContent__button__container", children: /* @__PURE__ */ a( "button", { className: e ? "expanded" : "", onClick: () => d(!e), children: [ /* @__PURE__ */ n("span", { children: t }), /* @__PURE__ */ n("span", { className: "SRC-primary-action-color", children: /* @__PURE__ */ n(c, { icon: e ? "close" : "add" }) }) ] } ) }), /* @__PURE__ */ n( "div", { className: `ExpandableContent__content__container ${e ? "" : "hide"}`, children: o } ) ] }); } export { p as default }; //# sourceMappingURL=ExpandableContent.js.map