This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/app/components/d-toggle-switch.js

16 lines
402 B
JavaScript

import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import I18n from "I18n";
export default class DiscourseToggleSwitch extends Component {
@tracked iconEnabled = true;
@tracked showIcon = this.iconEnabled && this.icon;
get computedLabel() {
if (this.args.label) {
return I18n.t(this.args.label);
}
return this.args.translatedLabel;
}
}