UNPKG

reactioning

Version:

Just a simple library to show beautiful reactions in your app.

25 lines (24 loc) 767 B
import { jsx as n } from "react/jsx-runtime"; import { useState as a } from "react"; import { ReactionContainer as c } from "../reaction-container.js"; import { ThumbDownIcon as u } from "./thumb-down-icon.js"; import '../../assets/thumb-down-reaction.css';const l = "_icon_13uzr_1", _ = "_animate_13uzr_5", p = "_moveDownUp_13uzr_1", s = { icon: l, animate: _, moveDownUp: p }, v = ({ reaction: o, onClick: e, ...i }) => { const [m, t] = a(!1); return /* @__PURE__ */ n(c, { reaction: o, onClick: (r) => { e == null || e(r), !o.selected && (t(!0), setTimeout(() => { t(!1); }, 1e3)); }, ...i, children: /* @__PURE__ */ n( u, { className: `${s.icon} ${m ? s.animate : ""}` } ) }); }; export { v as ThumbDownReaction };