component ChatBubble { props { @event action = function @event messageClick = function @event avatarClick = function @event linkClick = function size = "default" color = "primary" title = "" description = "" items = [] oneSided = false showAvatars = false showMetadata = false ariaLabel = "Conversation" variant = "default" class = "" } functions { function messageDirection(item) { return item.direction === "outgoing" ? "outgoing" : "incoming" } function selectMessage(item, index) { $emit("messageClick", { item: item, index: index, direction: messageDirection(item) }) } function selectAvatar(sourceEvent, item, index) { sourceEvent.stopPropagation() $emit("avatarClick", { item: item, index: index, direction: messageDirection(item) }) } function selectLink(sourceEvent, link, item, index) { sourceEvent.stopPropagation() $emit("linkClick", { link: link, item: item, index: index }) } function selectAction(sourceEvent, item, index) { sourceEvent.stopPropagation() $emit("action", { action: item.action || "retry", item: item, index: index }) } } view {
{#if title || description}
{#if title}

{title}

{/if} {#if description}

{description}

{/if}
{/if} {#if items.length}
{#each items as item, index}
{#if showAvatars && (item.avatarSrc || item.avatarFallback)} {/if}
{#if item.title}

{item.title}

{/if} {#if item.text}

{item.text}

{/if} {#if item.bullets && item.bullets.length}
    {#each item.bullets as bullet}
  • {bullet}
  • {/each}
{/if} {#if item.links && item.links.length} {/if}
{#if showMetadata && (item.timestamp || item.status || item.actionLabel)}
{#if item.statusIcon}{/if} {#if item.status}{item.status}{/if} {#if item.timestamp}{/if} {#if item.actionLabel} {/if}
{/if}
{/each}
{/if}
} }