import Component from "@glimmer/component"; import { tracked } from "@glimmer/tracking"; import { action } from "@ember/object"; import DButton from "discourse/components/d-button"; import icon from "discourse-common/helpers/d-icon"; import { i18n } from "discourse-i18n"; export default class AdminConfigAreaCard extends Component { @tracked collapsed = false; get computedHeading() { if (this.args.heading) { return i18n(this.args.heading); } return this.args.translatedHeading; } get hasHeading() { return this.args.heading || this.args.translatedHeading; } get computedDescription() { if (this.args.description) { return i18n(this.args.description); } return this.args.translatedDescription; } get hasDescription() { return this.args.description || this.args.translatedDescription; } get headerCaretIcon() { return this.collapsed ? "angle-right" : "angle-down"; } @action toggleCardDisplay() { this.collapsed = !this.collapsed; } }