UNPKG

@sippy-platform/valkyrie

Version:
43 lines (42 loc) 2.17 kB
var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __rest = (this && this.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; import { jsx as _jsx } from "react/jsx-runtime"; import HTMLReactParser from "html-react-parser"; import clsx from "clsx"; export default function ValkyrieIcon(_a) { var _b; var _c = _a.flip, flip = _c === void 0 ? undefined : _c, icon = _a.icon, _d = _a.rotate, rotate = _d === void 0 ? undefined : _d, _e = _a.spin, spin = _e === void 0 ? undefined : _e, _f = _a.beat, beat = _f === void 0 ? undefined : _f, _g = _a.fade, fade = _g === void 0 ? undefined : _g, _h = _a.bounce, bounce = _h === void 0 ? undefined : _h, className = _a.className, props = __rest(_a, ["flip", "icon", "rotate", "spin", "beat", "fade", "bounce", "className"]); return (_jsx("span", __assign({ className: clsx(className, "vi-icon", (_b = {}, _b["vi-rotate-90"] = rotate === 90, _b["vi-rotate-180"] = rotate === 180, _b["vi-rotate-270"] = rotate === 270, _b["vi-flip-x"] = flip === "x", _b["vi-flip-y"] = flip === "y", _b["vi-flip"] = flip === true, _b["vi-spin"] = spin === true, _b["vi-spin vi-spin-pulse"] = spin === "pulse", _b["vi-beat"] = beat, _b["vi-fade"] = fade, _b["vi-bounce"] = bounce, _b)) }, props, { children: HTMLReactParser(icon.data) }))); }