import { LightningElement, api } from "lwc"; import { normalizeToArray } from "dxUtils/normalizers"; export default class Topics extends LightningElement { private _topics: Array = []; @api get topics() { return this._topics; } set topics(value) { this._topics = normalizeToArray(value); } get normalizedTopics() { const { length } = this._topics; return this._topics?.map((topic, index) => ({ id: topic, label: topic, isLast: index === length - 1 })); } }