UNPKG

@ailibs/feather-react-ts

Version:

compact set of feather icons for React apps with type checking and auto-complete

32 lines 1.7 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 * as React from 'react'; import parse from 'html-react-parser'; import myIcons from './set'; export var Icon = function (_a) { var name = _a.name, props = __rest(_a, ["name"]); var myParse = parse(myIcons[name]); var _b = props.color, color = _b === void 0 ? 'currentColor' : _b, _c = props.size, size = _c === void 0 ? 24 : _c, _d = props.strokeWidth, strokeWidth = _d === void 0 ? 2 : _d, onClick = props.onClick, otherProps = __rest(props, ["color", "size", "strokeWidth", "onClick"]); return (React.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round", onClick: onClick }, otherProps), myParse)); }; //# sourceMappingURL=Icon.js.map