diff --git a/desktop/src/shared/ui/link-preview-attachment.tsx b/desktop/src/shared/ui/link-preview-attachment.tsx index 2fd843999..5a85dd943 100644 --- a/desktop/src/shared/ui/link-preview-attachment.tsx +++ b/desktop/src/shared/ui/link-preview-attachment.tsx @@ -1,11 +1,103 @@ -import { ChevronDown, ChevronUp, X } from "lucide-react"; -import { useEffect, useRef, useState } from "react"; +import { Globe, X } from "lucide-react"; import type { ResolvedLinkPreview } from "@/shared/lib/useResolvedLinkPreviews"; import { cn } from "@/shared/lib/cn"; import { Button } from "@/shared/ui/button"; +import { + Attachment, + AttachmentContent, + AttachmentMedia, + AttachmentTitle, + AttachmentTrigger, +} from "@/shared/ui/attachment"; -function LinkPreviewIdentity({ preview }: { preview: ResolvedLinkPreview }) { +function LinearLogo({ className }: { className?: string }) { + return ( + + ); +} + +function GitHubLogo({ className }: { className?: string }) { + return ( + + ); +} + +function GoogleDriveLogo({ className }: { className?: string }) { + return ( + + ); +} + +function GoogleDocsLogo({ className }: { className?: string }) { + return ( + + ); +} + +function GoogleSheetsLogo({ className }: { className?: string }) { + return ( + + ); +} + +function GoogleSlidesLogo({ className }: { className?: string }) { + return ( + + ); +} + +function getHostname(preview: ResolvedLinkPreview): string { + try { + return new URL(preview.href).hostname.replace(/^www\./, ""); + } catch { + return preview.provider; + } +} + +function LinkPreviewLogo({ preview }: { preview: ResolvedLinkPreview }) { if (preview.faviconDataUrl) { return ( ); } - return null; -} -function getHostname(preview: ResolvedLinkPreview): string { - try { - return new URL(preview.href).hostname.replace(/^www\./, ""); - } catch { - return preview.provider; + switch (preview.kind) { + case "github-issue": + case "github-pull-request": + case "github-repository": + return ; + case "linear-issue": + return ; + case "google-drive-file": + case "google-drive-folder": + return ; + case "google-docs-document": + return ; + case "google-sheets-spreadsheet": + return ; + case "google-slides-presentation": + return ; + case "generic-link": + return