import { ArrowIcon } from "../ui/icons.tsx"; import type { HTMLAttributes, ReactNode } from "react"; import { CopyButton } from "../feedback/CopyButton.tsx"; export function Kbd({ children, className = "", ...props }: HTMLAttributes) { return ( {children} ); } export function CodeBlock({ code, language = "text", filename, className = "", }: { code: string; language?: string; filename?: string; className?: string; }) { return (
{filename ?? language} Copy
        {code}
      
); } export function Quote({ children, author, cite, className = "", }: { children: ReactNode; author?: string; cite?: string; className?: string; }) { return (
{children}
{author && (
{cite ? {author} : author}
)}
); } export function Prose({ children, className = "", ...props }: HTMLAttributes) { return (
{children}
); } export function LinkCard({ href, title, description, eyebrow, className = "", ...props }: Omit, "title"> & { title: string; description?: string; eyebrow?: string; }) { return ( {eyebrow && {eyebrow}} {title} {description &&

{description}

}
); } export function FileCard({ href, name, size, type = "File", download = true, className = "", }: { href: string; name: string; size?: number; type?: string; download?: boolean; className?: string; }) { const bytes = size === undefined ? undefined : Math.max(0, Number.isFinite(size) ? size : 0); const formatted = bytes === undefined ? "" : bytes < 1024 ? `${bytes} B` : bytes < 1048576 ? `${(bytes / 1024).toFixed(1)} KiB` : `${(bytes / 1048576).toFixed(1)} MiB`; return ( {name} {type} {formatted && ` ยท ${formatted}`} {download ? "Download" : "Open"} ); }