import { LightningElement, api } from "lwc"; export default class CardTitle extends LightningElement { @api href!: string; @api target?: string | null = null; @api header!: string; private get isExternal() { return this.target === "_blank"; } private get titleToWrap() { return this.isExternal ? this.header.substring(0, this.header.lastIndexOf(" ")) : this.header; } private get needsSpace() { return this.titleToWrap.length > 0 && this.isExternal; } private get titleNoWrap() { return this.isExternal ? this.header.substring(this.header.lastIndexOf(" ") + 1) : null; } }