react-mana-symbols
Version:
React component library for rendering Magic: The Gathering mana symbols
14 lines (11 loc) • 671 B
JavaScript
import React from 'react';
import { parseManaSymbols } from '../utils.js';
import { ManaSymbol } from './ManaSymbol.js';
var DEFAULT_SIZE = 24;
var ManaCost = function (_a) {
var cost = _a.cost, _b = _a.size, size = _b === void 0 ? DEFAULT_SIZE : _b, _c = _a.className, className = _c === void 0 ? '' : _c;
var symbols = parseManaSymbols(cost);
return (React.createElement("span", { className: className }, symbols.map(function (symbol, index) { return (React.createElement(ManaSymbol, { key: "".concat(symbol, "-").concat(index), symbol: symbol, size: size, className: className })); })));
};
export { ManaCost };
//# sourceMappingURL=ManaCost.js.map