import Link from 'next/link'; import { DragEvent } from 'react'; import { Button } from '@headlessui/react'; import { PDFIcon, EPUBIcon } from '@/components/icons/Icons'; import { DocumentListDocument } from '@/types/documents'; interface DocumentListItemProps { doc: DocumentListDocument; onDelete: (doc: DocumentListDocument) => void; dragEnabled?: boolean; onDragStart?: (doc: DocumentListDocument) => void; onDragEnd?: () => void; onDragOver?: (e: DragEvent, doc: DocumentListDocument) => void; onDragLeave?: () => void; onDrop?: (e: DragEvent, doc: DocumentListDocument) => void; isDropTarget?: boolean; } export function DocumentListItem({ doc, onDelete, dragEnabled = true, onDragStart, onDragEnd, onDragOver, onDragLeave, onDrop, isDropTarget = false, }: DocumentListItemProps) { // Only allow drag and drop interactions for documents not in folders const isDraggable = dragEnabled && !doc.folderId; const allowDropTarget = !doc.folderId; return (
{doc.name}
{(doc.size / 1024 / 1024).toFixed(2)} MB