{#if !selectedFullItem}
{t('common.loading_ellipsis')}
{:else if !selectedFullItem.content}
{t('features.clipboard.ui.no_preview')}
{:else if selectedFullItem.redactedKinds?.length}
{t('features.clipboard.ui.paste_original')}
{:else if selectedFullItem.type === 'image'}
{#if imageLoading}
{t('features.clipboard.ui.loading_image')}
{:else if imageUrl}
openPreviewContextMenu(
e,
selectedFullItem,
selectedFullItem?.content ?? '',
true,
)}
/>
{:else}
{t('features.clipboard.ui.image_failed')}
{/if}
{#if selectedFullItem.metadata && (selectedFullItem.metadata.width || selectedFullItem.metadata.sizeBytes)}
{#if selectedFullItem.metadata.width && selectedFullItem.metadata.height}
{selectedFullItem.metadata.width} × {selectedFullItem.metadata
.height}
{/if}
{#if selectedFullItem.metadata.sizeBytes}
{formatBytes(selectedFullItem.metadata.sizeBytes as number)}
{/if}
{/if}
{:else if selectedFullItem.type === 'html'}
{#if showRenderedHtml}
{@html sanitizeHtml(selectedFullItem.content)}
{:else}
{getSourcePreview(selectedFullItem.content)}
{#if isContentTruncated(selectedFullItem.content)}
Showing first {MAX_PREVIEW_CHARS.toLocaleString()} of {selectedFullItem.content.length.toLocaleString()}
characters
{/if}
{/if}
{:else if selectedFullItem.type === 'rtf'}
{#if showRenderedHtml}
{stripRtf(selectedFullItem.content)}
{:else}
{getSourcePreview(selectedFullItem.content)}
{/if}
{#if isContentTruncated(selectedFullItem.content)}
Showing first {MAX_PREVIEW_CHARS.toLocaleString()} of {selectedFullItem.content.length.toLocaleString()}
characters
{/if}
{:else if selectedFullItem.type === 'files'}
{@const filePaths = parseFilePaths(selectedFullItem.content)}
{@const soloThumb =
filePaths.length === 1 ? (fileThumbnails[filePaths[0]] ?? null) : null}
{#if soloThumb}
openPreviewContextMenu(
e,
selectedFullItem,
filePaths[0],
IMAGE_EXT_RE.test(filePaths[0]),
)}
/>
{/if}
{#each filePaths as filePath}
{#if !soloThumb && fileThumbnails[filePath]}
e.preventDefault()}
/>
{:else}
{/if}
{fileNameOf(filePath)}
revealFile(filePath)}
title={t('features.clipboard.ui.reveal_title')}
ariaLabel="Reveal in Finder"
>
{/each}
{:else if showRenderedHtml && isUrl(selectedFullItem.content)}
{#if urlLoading}
{:else}
{getUrlDomain(selectedFullItem.content)}
{selectedFullItem.content.trim()}
{#if urlFetchFailed}
{t('features.clipboard.ui.preview_unavailable')}
{/if}
{/if}
{:else}
{#if showRenderedHtml}
{@html renderMarkdown(selectedFullItem.content)}
{#if isContentTruncated(selectedFullItem.content)}
Showing first {MAX_PREVIEW_CHARS.toLocaleString()} of {selectedFullItem.content.length.toLocaleString()}
characters
{/if}
{:else}
{getSourcePreview(selectedFullItem.content)}
{#if isContentTruncated(selectedFullItem.content)}
Showing first {MAX_PREVIEW_CHARS.toLocaleString()} of {selectedFullItem.content.length.toLocaleString()}
characters
{/if}
{/if}
{/if}
{/if}
{#if clipboardViewState.selectedIds.length > 1}
{clipboardViewState.selectedIds.length} items selected · Enter to merge & paste
{:else if selectedFullItem}
{@const customTitle =
clipboardViewState.selectedItem?.customTitle ?? selectedFullItem.customTitle}