14 lines
342 B
JavaScript
14 lines
342 B
JavaScript
|
import {helper} from '@ember/component/helper';
|
||
|
import {htmlSafe} from '@ember/string';
|
||
|
|
||
|
export function backgroundImageStyle([url]/*, hash*/) {
|
||
|
if (url) {
|
||
|
let safeUrl = encodeURI(decodeURI(url));
|
||
|
return htmlSafe(`background-image: url(${safeUrl});`);
|
||
|
}
|
||
|
|
||
|
return '';
|
||
|
}
|
||
|
|
||
|
export default helper(backgroundImageStyle);
|