discourse/app/assets/javascripts/admin/addon/components/admin-config-area-empty-list.gjs
Martin Brennan 1f538a81a8
DEV: Consistent AdminConfigAreaEmptyList options (#29975)
Followup ccc8e37dde6dd16de1f1103d60065c1b5afcbc6e

The fix above was good, but I would prefer to give
the option of untranslated vs translated label like
I have for other admin components for consistency.
2024-11-28 15:31:04 +10:00

34 lines
890 B
Plaintext

import Component from "@glimmer/component";
import { htmlSafe } from "@ember/template";
import DButton from "discourse/components/d-button";
import concatClass from "discourse/helpers/concat-class";
import { i18n } from "discourse-i18n";
export default class AdminConfigAreaEmptyList extends Component {
get emptyLabel() {
if (this.args.emptyLabelTranslated) {
return this.args.emptyLabelTranslated;
}
return i18n(this.args.emptyLabel);
}
<template>
<div class="admin-config-area-empty-list">
{{htmlSafe this.emptyLabel}}
{{#if @ctaLabel}}
<DButton
@label={{@ctaLabel}}
class={{concatClass
"btn-default btn-small admin-config-area-empty-list__cta-button"
@ctaClass
}}
@action={{@ctaAction}}
@route={{@ctaRoute}}
/>
{{/if}}
</div>
</template>
}