import React from 'react' /** * Text-style skeleton — matches a rendered markdown article layout. * Used by `` as the default for `markdown` (and unknown * document types). Embedders can override via `renderSkeleton`. */ export function MarkdownSkeleton() { return (
) } /** * Embed-style skeleton — matches the iframe loading state for `pdf`, * `google_sheet`, `figma`, and `file` document types. Used by * `` as the default for non-markdown documentTypes. * * The skeleton is documentType-aware so its layout matches the actual * viewer that will replace it: * - `pdf` → header with title + TWO buttons (Preview, Download) * - `google_sheet`/`figma` → header with title + ONE button/toggle * - `file` → centered FileDownloadCard-style box * - undefined / others → generic (1-button header) * * IMPORTANT: bars use `bg-ods-border` (NOT `bg-ods-skeleton`). The * `--ods-skeleton` token resolves to TRANSPARENT in this build, leaving * the skeleton box visually empty — the embed skeleton was the loudest * surface affected (a full-height iframe area showing nothing). Same fix * the chat-message-row skeleton already documents in its inline comment. */ export interface EmbedSkeletonProps { /** When provided, the header layout matches the eventual viewer's * button count + arrangement, so the layout doesn't shift on load. */ documentType?: 'pdf' | 'google_sheet' | 'figma' | 'file' | string } export function EmbedSkeleton({ documentType }: EmbedSkeletonProps = {}) { // Centered card shape for the `file` documentType — matches // ``'s `flex flex-col items-center justify-center py-16` // + bordered card with icon, name, type/size row, Download button. if (documentType === 'file') { return (
) } // PDF viewer has TWO buttons (Preview + Download); Sheets / Figma // render ONE (Open / view-toggle). Default to one for unknown types. const buttonCount = documentType === 'pdf' ? 2 : 1 return (
{/* Header — matches the actual viewer's * `flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between` * (mobile-stacked, desktop-row). */}
{/* Left: icon + title */}
{/* Right: 1 or 2 buttons. Mobile = full-width; desktop = auto. */}
{Array.from({ length: buttonCount }).map((_, i) => (
))}
{/* Body — clean iframe-sized rectangle, no fake inner placeholder * cruft. Matches the viewer's default `calc(100vh - 250px)` height. */}
) }