2023-02-23 23:32:53 +08:00
|
|
|
import {
|
|
|
|
attributeBindings,
|
|
|
|
classNameBindings,
|
|
|
|
classNames,
|
|
|
|
tagName,
|
|
|
|
} from "@ember-decorators/component";
|
2019-10-31 04:28:29 +08:00
|
|
|
import { alias } from "@ember/object/computed";
|
2023-02-23 23:32:53 +08:00
|
|
|
import Component from "@ember/component";
|
2019-11-08 05:38:28 +08:00
|
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
2018-08-02 06:40:59 +08:00
|
|
|
|
2023-02-23 23:32:53 +08:00
|
|
|
@tagName("td")
|
|
|
|
@classNames("admin-report-table-cell")
|
|
|
|
@classNameBindings("type", "property")
|
|
|
|
@attributeBindings("value:title")
|
|
|
|
export default class AdminReportTableCell extends Component {
|
|
|
|
options = null;
|
|
|
|
|
|
|
|
@alias("label.type") type;
|
|
|
|
@alias("label.mainProperty") property;
|
|
|
|
@alias("computedLabel.formattedValue") formattedValue;
|
|
|
|
@alias("computedLabel.value") value;
|
2018-08-02 06:40:59 +08:00
|
|
|
|
2019-11-08 05:38:28 +08:00
|
|
|
@discourseComputed("label", "data", "options")
|
2018-08-02 06:40:59 +08:00
|
|
|
computedLabel(label, data, options) {
|
|
|
|
return label.compute(data, options || {});
|
2023-02-23 23:32:53 +08:00
|
|
|
}
|
|
|
|
}
|