{#if mode === 'expanded'}
{#if message.reply_to && message.parent_author_name && !isReply}
{ e.stopPropagation(); const el = document.getElementById(`msg-${message.reply_to}`); if (el) el.scrollIntoView({ behavior: 'smooth', block: 'center' }); }}> ↩ {message.parent_author_name}: {truncate(stripHtml(message.parent_body ?? ''), 50)}
{/if} {#if showAuthor || showTimestamp}
{#if showAuthor}
{message.author_name ?? 'Ukjent'}
{/if} {#if showTimestamp}
{formatTime(message.created_at)}
{/if} {#if message.pinned}
📌
{/if}
{/if}
{#if isOwnMessage && !editing && callbacks.onEdit}
✏️
{/if} {#if callbacks.onConvertToKanban}
📋
{/if} {#if callbacks.onConvertToCalendar}
📅
{/if} {#if callbacks.onMagic}
✨
{#if showAiMenu && aiPrompts.length > 1}
{#each aiPrompts as prompt}
{ e.stopPropagation(); selectAiAction(prompt.action); }} >
{prompt.icon ?? '✨'}
{prompt.label ?? prompt.action}
{/each}
{/if}
{/if}
{#if isOwnMessage && !editing && callbacks.onDelete}
{/if} {#if callbacks.onTogglePin}
📌
{/if} {#if callbacks.onReply}
💬
{/if}
{#if confirmingDelete}
Slette melding?
Slett
Avbryt
{/if} {#if editing}
{ if (e.key === 'Escape') cancelEdit(); }}>
submitEdit(html)} />
Enter = lagre · Esc = avbryt
Avbryt
{:else} {#if expanded}
{ e.stopPropagation(); expanded = false; checkClamped(); }}> Vis mindre
{/if}
{@html displayBody}
{#if isClamped && !expanded}
{ e.stopPropagation(); expanded = true; }}> Vis mer
{:else if expanded}
{ e.stopPropagation(); expanded = false; checkClamped(); }}> Vis mindre
{/if} {#if isAiProcessing}
✨ AI behandler…
{/if} {#if isEdited && !editing} {/if} {/if} {#if hasReactions || callbacks.onReaction}
{#each message.reactions ?? [] as r}
handleReaction(e, r.reaction)} >{r.reaction} {r.count}
{/each} {#if callbacks.onReaction && availableReactions.length > 0}
{#each availableReactions as emoji}
handleReaction(e, emoji)} >{emoji}
{/each}
{/if}
{/if} {#if hasBadges}
{#if message.kanban_view}
Kort
{/if} {#if message.calendar_view}
Hendelse
{/if}
{/if}
{:else if mode === 'compact'}
{message.title ?? bodyPreview}
{#if message.body && message.title}
{bodyPreview}
{/if}
{:else if mode === 'calendar'}
{#if message.calendar_view && !message.calendar_view.all_day}
{formatTime(message.calendar_view.starts_at)}
{/if} {message.title ?? stripHtml(message.body)}
{/if}