UNPKG

reactioning

Version:

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

25 lines (24 loc) 761 B
import { jsx as n } from "react/jsx-runtime"; import { useState as r } from "react"; import { RocketIcon as m } from "./rocket-icon.js"; import { ReactionContainer as l } from "../reaction-container.js"; import '../../assets/rocket-reaction.css';const d = "_icon_v87el_1", _ = "_animate_v87el_5", f = "_moveAndVibrate_v87el_1", i = { icon: d, animate: _, moveAndVibrate: f }, h = ({ reaction: t, onClick: e, ...a }) => { const [s, o] = r(!1); return /* @__PURE__ */ n(l, { reaction: t, onClick: (c) => { e == null || e(c), !t.selected && (o(!0), setTimeout(() => { o(!1); }, 1e3)); }, ...a, children: /* @__PURE__ */ n( m, { className: `${i.icon} ${s ? i.animate : ""}` } ) }); }; export { h as RocketReaction };