mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-09 13:36:33 +00:00
Update Button.ts
This commit is contained in:
@@ -7,6 +7,7 @@ import { translateText } from "../../Utils";
|
|||||||
export class OButton extends LitElement {
|
export class OButton extends LitElement {
|
||||||
@property({ type: String }) title = "";
|
@property({ type: String }) title = "";
|
||||||
@property({ type: String }) translationKey = "";
|
@property({ type: String }) translationKey = "";
|
||||||
|
@property({ type: String }) icon = "";
|
||||||
@property({ type: Boolean }) secondary = false;
|
@property({ type: Boolean }) secondary = false;
|
||||||
@property({ type: Boolean }) block = false;
|
@property({ type: Boolean }) block = false;
|
||||||
@property({ type: Boolean }) blockDesktop = false;
|
@property({ type: Boolean }) blockDesktop = false;
|
||||||
@@ -28,9 +29,14 @@ export class OButton extends LitElement {
|
|||||||
})}
|
})}
|
||||||
?disabled=${this.disable}
|
?disabled=${this.disable}
|
||||||
>
|
>
|
||||||
${`${this.translationKey}` === ""
|
<div class="flex items-center justify-center">
|
||||||
? `${this.title}`
|
${this.icon && html`<img src="icons/${this.icon}" class="mr-2 h-5 w-5" />`}
|
||||||
: `${translateText(this.translationKey)}`}
|
<span>
|
||||||
|
${`${this.translationKey}` === ""
|
||||||
|
? `${this.title}`
|
||||||
|
: `${translateText(this.translationKey)}`}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</button>
|
</button>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user