"use client"; import { FileText, Paperclip } from "lucide-react"; import { useState } from "react"; import { tr } from "@/i18n/tr"; import type { AttachmentInfo } from "../service"; import { AttachmentViewer } from "./attachment-viewer"; const t = tr.attachments; const VISIBLE = 4; /** Ayrıntıda küçük önizleme şeridi (en fazla 4 + "+N"); tıklayınca görüntüleyici açılır. */ export function AttachmentStrip({ items }: { items: AttachmentInfo[] }) { const [viewer, setViewer] = useState(null); if (!items.length) return null; const shown = items.slice(0, VISIBLE); const rest = items.length - shown.length; return (
{t.count(items.length)}
    {shown.map((item, i) => (
  • setViewer(i)} /> {rest > 0 && i === shown.length - 1 ? ( ) : null}
  • ))}
!open && setViewer(null)} />
); } export function AttachmentThumb({ item, onClick, className = "size-12", }: { item: AttachmentInfo; onClick?: () => void; className?: string; }) { return ( ); }