import { useLibrary } from './useLibrary' import { useAuth } from '../auth/useAuth' export const LibraryHeader = ({ currentTab, onTabChange }: { currentTab: 'library' | 'trash', onTabChange: (tab: 'library' | 'trash') => void }) => { const { logout } = useAuth() const { searchQuery, setSearchQuery, fetchDocuments, fetchTrash, selectedIds, clearSelection, selectAll, bulkDelete, bulkRestore, emptyTrash, documents } = useLibrary() const handleSearch = (e: React.FormEvent) => { e.preventDefault() if (currentTab === 'library') { fetchDocuments(searchQuery) } } const handleTabChange = (tab: 'library' | 'trash') => { onTabChange(tab) if (tab === 'library') { fetchDocuments() } else { fetchTrash() } } const isSelectionMode = selectedIds.size > 0 const allSelected = documents.length > 0 && selectedIds.size === documents.length return (
{/* Left: Branding & Tabs */}
P

PaperJet

{/* Right: Search & Actions */}
{isSelectionMode ? (
{selectedIds.size} selected
{currentTab === 'library' ? ( ) : ( <> )}
) : ( <> {currentTab === 'library' && (
setSearchQuery(e.target.value)} placeholder="Search documents..." className="block w-full pl-10 pr-3 py-2 border border-gray-200 dark:border-gray-700 rounded-xl leading-5 bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent sm:text-sm transition-all" />
)} {currentTab === 'trash' && ( )} {currentTab === 'library' && ( )} )}
) }