import { ExternalLinkIcon } from "lucide-react"; import { Link } from "react-router-dom"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; import { useTranslate } from "@/utils/i18n"; interface AttachmentMetadataLineProps { className?: string; items: Array; } interface AttachmentSourceChipProps { memoName?: string; unlinkedLabelKey?: "attachment-library.labels.not-linked" | "attachment-library.labels.unused"; } interface AttachmentOpenButtonProps { className?: string; href: string; } export const AttachmentMetadataLine = ({ className, items }: AttachmentMetadataLineProps) => { const visibleItems = items.filter((item): item is string => Boolean(item)); if (visibleItems.length === 0) { return null; } return (
{visibleItems.map((item, index) => ( {index > 0 && •} {item} ))}
); }; export const AttachmentSourceChip = ({ memoName, unlinkedLabelKey = "attachment-library.labels.not-linked", }: AttachmentSourceChipProps) => { const t = useTranslate(); if (!memoName) { return ( {t(unlinkedLabelKey)} ); } return ( {t("attachment-library.labels.memo")} ); }; export const AttachmentOpenButton = ({ className, href }: AttachmentOpenButtonProps) => { const t = useTranslate(); return ( ); };