mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 06:30:15 +08:00
a433b30650
This conversion was achieved using the ember-native-class-codemod, plus a handful of manual fixes/tweaks
25 lines
790 B
JavaScript
25 lines
790 B
JavaScript
import {
|
|
attributeBindings,
|
|
classNameBindings,
|
|
classNames,
|
|
tagName,
|
|
} from "@ember-decorators/component";
|
|
import Component from "@ember/component";
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
|
|
|
@tagName("th")
|
|
@classNames("admin-report-table-header")
|
|
@classNameBindings("label.mainProperty", "label.type", "isCurrentSort")
|
|
@attributeBindings("label.title:title")
|
|
export default class AdminReportTableHeader extends Component {
|
|
@discourseComputed("currentSortLabel.sortProperty", "label.sortProperty")
|
|
isCurrentSort(currentSortField, labelSortField) {
|
|
return currentSortField === labelSortField;
|
|
}
|
|
|
|
@discourseComputed("currentSortDirection")
|
|
sortIcon(currentSortDirection) {
|
|
return currentSortDirection === 1 ? "caret-up" : "caret-down";
|
|
}
|
|
}
|