import Layout from "../classes/Layout" ; import Profile from "../classes/Profile" ; import { defaultProfile , duplicatedLinesOfCode , leakPeriod } from "./Profiles" ; import { PreviewPicture } from "../classes/PreviewPicture" ; import { district , evostreet } from "./Layouts" ; const defaultDistrict = new PreviewPicture ( "/static/resources/preview/district_complexity_loc_EXTINT.png" , district , defaultProfile ) ; const defaultEvostreet = new PreviewPicture ( "/static/resources/preview/evostreet_complexity_loc_EXTINT.png" , evostreet , defaultProfile ) ; const leakDistrict = new PreviewPicture ( "/static/resources/preview/district_complexity_newLOC_ApacheCommons_Lang.png" , district , leakPeriod ) ; const leakEvostreet = new PreviewPicture ( "/static/resources/preview/evostreet_complexity_newLOC_ApacheCommons_Lang.png" , evostreet , leakPeriod ) ; const duplicateDistrict = new PreviewPicture ( "/static/resources/preview/district_complexity_duplicatedLOC_LMSAPP_SHOP.png" , district , duplicatedLinesOfCode ) ; const duplicateEvostreet = new PreviewPicture ( "/static/resources/preview/evostreet_complexity_duplicatedLOC_LMSAPP_SHOP.png" , evostreet , duplicatedLinesOfCode ) ; const placeholder = new PreviewPicture ( "/static/resources/preview/placeholderLogo.png" ) ; export { defaultDistrict , defaultEvostreet , leakDistrict , leakEvostreet , duplicateDistrict , duplicateEvostreet , placeholder , } ; export const availablePreviewPictures = [ defaultDistrict , defaultEvostreet , leakDistrict , leakEvostreet , duplicateDistrict , duplicateEvostreet , placeholder , ] ; export function getPreviewBackground ( layout , profile ) { for ( const preview of availablePreviewPictures ) { if ( preview . forLayout ( layout ) && preview . forProfile ( profile ) ) { return preview ; } } return placeholder ; }