import { MagnifyingGlass, Plus, Trash } from '@phosphor-icons/react' import type { VaultEntry } from '../../types' import type { SortOption, SortDirection } from '../../utils/noteListHelpers' import { Input } from '@/components/ui/input' import { useDragRegion } from '../../hooks/useDragRegion' import { SortDropdown } from '../SortDropdown' export function NoteListHeader({ title, typeDocument, isEntityView, isTrashView, trashCount, listSort, listDirection, customProperties, sidebarCollapsed, searchVisible, search, onSortChange, onCreateNote, onOpenType, onToggleSearch, onSearchChange, onEmptyTrash }: { title: string typeDocument: VaultEntry | null isEntityView: boolean isTrashView: boolean trashCount: number listSort: SortOption listDirection: SortDirection customProperties: string[] sidebarCollapsed?: boolean searchVisible: boolean search: string onSortChange: (groupLabel: string, option: SortOption, direction: SortDirection) => void onCreateNote: () => void onOpenType: (entry: VaultEntry) => void onToggleSearch: () => void onSearchChange: (value: string) => void onEmptyTrash?: () => void }) { const { onMouseDown: onDragMouseDown } = useDragRegion() return ( <>

onOpenType(typeDocument) : undefined} data-testid={typeDocument ? 'type-header-link' : undefined} > {title}

{!isEntityView && } {isTrashView && trashCount > 0 && ( )} {!isTrashView && ( )}
{searchVisible && (
onSearchChange(e.target.value)} className="h-8 text-[13px]" autoFocus />
)} ) }