import * as React from "react" ; import { PreviewPicture } from "../../classes/PreviewPicture" ; import { lazyInject } from "../../inversify.config" ; import ComponentStatusStore from "../../stores/ComponentStatusStore" ; export interface PreviewPictureComponentProps { previewPicture : PreviewPicture ; } export default class PreviewPictureComponent extends React . Component < PreviewPictureComponentProps , any > { @ lazyInject ( "ComponentStatusStore" ) private readonly componentStatusStore ! : ComponentStatusStore ; public render ( ) { const preview = this . props . previewPicture ; let url = preview . bgPicture ; const baseUrl = this . componentStatusStore . appConfiguration . baseUrl ; if ( baseUrl ) { url = baseUrl + url ; } const previewStyle = { backgroundImage : "url(" + url + ")" , } ; return < div className = { "preview" } style = { previewStyle } > < /div>; } }