github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/app/helpers/x-icon.js (about) 1 import { helper } from '@ember/component/helper'; 2 import { inlineSvg } from 'ember-inline-svg/helpers/inline-svg'; 3 4 // Generated at compile-time by ember-inline-svg 5 import SVGs from '../svgs'; 6 7 /** 8 * Icon Helper 9 * 10 * Usage: {{x-icon name}} 11 * 12 * Renders an inline svg element by looking it up at `/public/images/icons/${name}.svg` 13 */ 14 export function xIcon(params, options) { 15 const name = params[0]; 16 const classes = [options.class, 'icon', `icon-is-${name}`] 17 .compact() 18 .join(' '); 19 20 return inlineSvg(SVGs, name, { class: classes }); 21 } 22 23 export default helper(xIcon);