DEV: Move topic-list-item-class transformer to a getter (#30726)

See 03bb43f
This commit is contained in:
Jarek Radosz 2025-01-11 12:13:47 +01:00 committed by GitHub
parent af8f01a0d3
commit 7a4da92657
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,5 @@
import Component from "@glimmer/component";
import { array, concat, hash } from "@ember/helper";
import { concat, hash } from "@ember/helper";
import { on } from "@ember/modifier";
import { action } from "@ember/object";
import { next } from "@ember/runloop";
@ -183,6 +183,13 @@ export default class Item extends Component {
);
}
get additionalClasses() {
return applyValueTransformer("topic-list-item-class", [], {
topic: this.args.topic,
index: this.args.index,
});
}
<template>
<tr
{{! template-lint-disable no-invalid-interactive }}
@ -206,9 +213,7 @@ export default class Item extends Component {
(if @topic.pinned "pinned")
(if @topic.closed "closed")
this.tagClassNames
(applyValueTransformer
"topic-list-item-class" (array) (hash topic=@topic index=@index)
)
this.additionalClasses
}}
>
<PluginOutlet