mapcomplete/UI/Base/SubtleButton.ts
2020-07-29 16:46:45 +02:00

27 lines
No EOL
644 B
TypeScript

import {UIElement} from "../UIElement";
import Translations from "../i18n/Translations";
import Combine from "./Combine";
export class SubtleButton extends UIElement{
private imageUrl: string;
private message: UIElement;
constructor(imageUrl: string, message: string | UIElement) {
super(undefined);
this.message = Translations.W(message);
this.imageUrl = imageUrl;
}
InnerRender(): string {
return new Combine([
'<span class="subtle-button">',
`<img src='${this.imageUrl}'>`,
this.message,
'</span>'
]).Render();
}
}