2024-06-06 21:07:08 +08:00
|
|
|
import Component from "@glimmer/component";
|
|
|
|
import { tracked } from "@glimmer/tracking";
|
2024-07-29 12:20:12 +08:00
|
|
|
import I18n from "discourse-i18n";
|
2024-06-06 21:07:08 +08:00
|
|
|
|
|
|
|
export default class AdminConfigAreaCard extends Component {
|
|
|
|
@tracked collapsed = false;
|
|
|
|
|
2024-07-29 12:20:12 +08:00
|
|
|
get computedHeading() {
|
|
|
|
if (this.args.heading) {
|
|
|
|
return I18n.t(this.args.heading);
|
|
|
|
}
|
|
|
|
return this.args.translatedHeading;
|
|
|
|
}
|
|
|
|
|
2024-10-15 23:54:38 +08:00
|
|
|
get hasHeading() {
|
|
|
|
return this.args.heading || this.args.translatedHeading;
|
|
|
|
}
|
|
|
|
|
2024-06-06 21:07:08 +08:00
|
|
|
<template>
|
2024-07-01 10:40:37 +08:00
|
|
|
<section class="admin-config-area-card" ...attributes>
|
2024-10-15 23:54:38 +08:00
|
|
|
<div class="admin-config-area-card__header-wrapper">
|
|
|
|
{{#if this.hasHeading}}
|
|
|
|
<h3
|
|
|
|
class="admin-config-area-card__title"
|
|
|
|
>{{this.computedHeading}}</h3>
|
|
|
|
{{else}}
|
2024-10-17 00:13:36 +08:00
|
|
|
{{#if (has-block "header")}}
|
|
|
|
<h3 class="admin-config-area-card__title">{{yield to="header"}}</h3>
|
|
|
|
{{/if}}
|
2024-10-15 23:54:38 +08:00
|
|
|
{{/if}}
|
|
|
|
{{#if (has-block "headerAction")}}
|
|
|
|
<div class="admin-config-area-card__header-action">
|
|
|
|
{{yield to="headerAction"}}
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
2024-06-06 21:07:08 +08:00
|
|
|
<div class="admin-config-area-card__content">
|
2024-10-15 23:54:38 +08:00
|
|
|
{{yield to="content"}}
|
2024-06-06 21:07:08 +08:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</template>
|
|
|
|
}
|