2023-02-23 10:32:53 -05:00
|
|
|
import {
|
|
|
|
attributeBindings,
|
|
|
|
classNameBindings,
|
|
|
|
classNames,
|
|
|
|
tagName,
|
|
|
|
} from "@ember-decorators/component";
|
2019-10-30 16:28:29 -04:00
|
|
|
import { alias } from "@ember/object/computed";
|
2023-02-23 10:32:53 -05:00
|
|
|
import Component from "@ember/component";
|
2019-11-07 16:38:28 -05:00
|
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
2018-08-01 18:40:59 -04:00
|
|
|
|
2023-02-23 10:32:53 -05: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-01 18:40:59 -04:00
|
|
|
|
2019-11-07 16:38:28 -05:00
|
|
|
@discourseComputed("label", "data", "options")
|
2018-08-01 18:40:59 -04:00
|
|
|
computedLabel(label, data, options) {
|
|
|
|
return label.compute(data, options || {});
|
2023-02-23 10:32:53 -05:00
|
|
|
}
|
|
|
|
}
|