import {Pipe, PipeTransform} from '@angular/core';

declare const APP_PATH;
const isInElectron = localStorage.getItem('electron');

@Pipe({
  name: 'backgroundImage'
})
export class BackgroundImagePipe implements PipeTransform {

  transform(value: any, coursewareSid?: string) {
    return `url(${value})` ;
    // if (isInElectron && ElectronUtil.hasCached(coursewareSid, value)) {
    //   ret = `url(file://${APP_PATH}/courseware_cache/${coursewareSid}/${value})`;
    // }
    // return ret;
  }

}
