github.com/manicqin/nomad@v0.9.5/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}`].compact().join(' ');
    17  
    18    return inlineSvg(SVGs, name, { class: classes });
    19  }
    20  
    21  export default helper(xIcon);