Email Detail
square-ui/email-detailFreeComponent
Email detail view component with full email content display.
Install it
npx shadcn@latest add https://square.lndev.me/registry/email-detail.jsonSource
1"use client";23import { format } from "date-fns";4import {5 SparklesIcon,6 ArchiveIcon,7 Settings2Icon,8 Trash2Icon,9 MailPlusIcon,10 FolderOpenIcon,11 MoreVerticalIcon,12 ChevronLeftIcon,13 ChevronRightIcon,14 StarIcon,15 CircleArrowOutUpRightIcon,16 ReceiptTextIcon,17 ShieldIcon,18 XIcon,19 FileTextIcon,20 FileSpreadsheetIcon,21 FileIcon,22 ImageIcon,23 FileArchiveIcon,24 ClockIcon,25 CheckCheckIcon,26 CalendarIcon,27 TagIcon,28 FilterIcon,29 Volume2Icon,30} from "lucide-react";31import { useEmailsStore } from "@/store/emails-store";32import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar";33import { Button } from "@/components/ui/button";34import {35 DropdownMenu,36 DropdownMenuContent,37 DropdownMenuItem,38 DropdownMenuSeparator,39 DropdownMenuTrigger,40 DropdownMenuSub,41 DropdownMenuSubContent,42 DropdownMenuSubTrigger,43} from "@/components/ui/dropdown-menu";44import {45 Tooltip,46 TooltipContent,47 TooltipTrigger,48} from "@/components/ui/tooltip";49import { VerifiedIcon } from "@/components/ui/verified-icon";50import { cn } from "@/lib/utils";5152function getFileIcon(type: string) {53 if (type.includes("pdf")) {54 return FileTextIcon;55 } else if (type.includes("word") || type.includes("document")) {56 return FileTextIcon;57 } else if (type.includes("excel") || type.includes("spreadsheet")) {58 return FileSpreadsheetIcon;59 } else if (type.includes("powerpoint") || type.includes("presentation")) {60 return FileTextIcon;61 } else if (62 type.includes("image") ||63 type.includes("png") ||64 type.includes("jpg") ||65 type.includes("jpeg")66 ) {67 return ImageIcon;68 } else if (type.includes("zip") || type.includes("archive")) {69 return FileArchiveIcon;70 }71 return FileIcon;72}7374function getFileGradient(type: string) {75 if (type.includes("pdf")) {76 return { start: "#f75936", end: "#a73a24" };77 } else if (type.includes("word") || type.includes("document")) {78 return { start: "#2b5797", end: "#1e3d6b" };79 } else if (type.includes("excel") || type.includes("spreadsheet")) {80 return { start: "#217346", end: "#165530" };81 } else if (type.includes("powerpoint") || type.includes("presentation")) {82 return { start: "#d04423", end: "#9b3319" };83 } else if (84 type.includes("image") ||85 type.includes("png") ||86 type.includes("jpg") ||87 type.includes("jpeg")88 ) {89 return { start: "#8b5cf6", end: "#6d28d9" };90 } else if (type.includes("zip") || type.includes("archive")) {91// … truncated
Files it writes
More from square-ui
All 22 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Chat Conversation Viewchat-conversation-view | square-ui | Components | Free | no deps | |
| Chat Input Boxchat-input-box | square-ui | Components | Free | no deps | |
| Chat Mainchat-main | square-ui | Components | Free | no deps | |
| Chat Messagechat-message | square-ui | Components | Free | no deps | |
| Chat Sidebarchat-sidebar | square-ui | Components | Free | no deps | |
| Chat Welcome Screenchat-welcome-screen | square-ui | Components | Free | no deps | |
| Email Listemail-list | square-ui | Components | Free | no deps | |
| Emails Headeremails-header | square-ui | Components | Free | no deps |
