import { CONTROL_H, ICON_BTN, INPUT, Segmented } from "./ui"; export type ViewMode = "list" | "grid"; interface Props { search: string; onSearch: (v: string) => void; downloadedOnly: boolean; onDownloadedOnly: (v: boolean) => void; online: boolean; reachable: boolean; forcedOffline: boolean; onToggleForcedOffline: () => void; onRefresh: () => void; refreshing: boolean; refreshProgress: { done: number; total: number } | null; resultCount: number; view: ViewMode; onView: (v: ViewMode) => void; sidebarHidden: boolean; onShowSidebar: () => void; /** Present only when there is something to delete. */ onDeleteAll?: () => void; /** Matches the sidebar's inset so the two headers share a baseline. */ titleBarInset: boolean; } /** Neutral outline until active; active is the one filled state. */ function Toggle({ active, onClick, children, title, disabled, }: { active: boolean; onClick: () => void; children: React.ReactNode; title?: string; disabled?: boolean; }) { return ( ); } export default function TopBar({ search, onSearch, downloadedOnly, onDownloadedOnly, online, reachable, forcedOffline, onToggleForcedOffline, onRefresh, refreshing, refreshProgress, resultCount, view, onView, sidebarHidden, onShowSidebar, onDeleteAll, titleBarInset, }: Props) { const pct = refreshProgress && refreshProgress.total > 0 ? (refreshProgress.done / refreshProgress.total) * 100 : null; return (