open-nomad/ui/app/helpers/x-icon.js

24 lines
582 B
JavaScript
Raw Normal View History

import { helper } from '@ember/component/helper';
import { inlineSvg } from 'ember-inline-svg/helpers/inline-svg';
// Generated at compile-time by ember-inline-svg
import SVGs from '../svgs';
/**
* Icon Helper
*
* Usage: {{x-icon name}}
*
* Renders an inline svg element by looking it up at `/public/images/icons/${name}.svg`
*/
export function xIcon(params, options) {
const name = params[0];
2021-12-28 16:08:12 +00:00
const classes = [options.class, 'icon', `icon-is-${name}`]
.compact()
.join(' ');
return inlineSvg(SVGs, name, { class: classes });
}
export default helper(xIcon);