2021-06-18 01:25:13 +02:00
|
|
|
import Combine from "../Base/Combine";
|
|
|
|
import Attribution from "./Attribution";
|
|
|
|
import Img from "../Base/Img";
|
2021-09-29 23:56:59 +02:00
|
|
|
import {ProvidedImage} from "../../Logic/ImageProviders/ImageProvider";
|
2021-09-15 01:33:52 +02:00
|
|
|
import BaseUIElement from "../BaseUIElement";
|
2021-06-18 01:25:13 +02:00
|
|
|
|
|
|
|
|
|
|
|
export class AttributedImage extends Combine {
|
|
|
|
|
2021-09-29 23:56:59 +02:00
|
|
|
constructor(imageInfo: ProvidedImage) {
|
2021-09-15 01:33:52 +02:00
|
|
|
let img: BaseUIElement;
|
|
|
|
let attr: BaseUIElement
|
2021-09-29 23:56:59 +02:00
|
|
|
img = new Img(imageInfo.url);
|
|
|
|
attr = new Attribution(imageInfo.provider.GetAttributionFor(imageInfo.url),
|
|
|
|
imageInfo.provider.SourceIcon(),
|
|
|
|
)
|
2021-09-15 01:33:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
super([img, attr]);
|
2021-06-18 01:25:13 +02:00
|
|
|
this.SetClass('block relative h-full');
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|