import { useTranslation } from 'react-i18next'; import { Check, CheckSquare, Columns2, Columns3, Download, FileDown, LayoutGrid, LayoutList, List, MoreHorizontal, Plus, RefreshCcw, SortAsc, Upload, Zap, } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Label } from '@/components/ui/label'; import { Switch } from '@/components/ui/switch'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; interface AccountsToolbarProps { autoSwitchEnabled: boolean | undefined; isSettingsLoading: boolean; onToggleAutoSwitch: (checked: boolean) => void; isAutoSwitchPending: boolean; selectedCount: number; totalCount: number; onToggleSelectAll: () => void; onForcePoll: () => void; isForcePollPending: boolean; onSyncLocal: () => void; isSyncPending: boolean; onOpenExportDialog: () => void; onOpenImportDialog: () => void; onOpenAddDialog: () => void; currentSort: string; sortOptions: readonly string[]; sortI18nKeys: Record; onSortChange: (sort: string) => void; gridLayout: string; onLayoutChange: (layout: string) => void; } export function AccountsToolbar(props: AccountsToolbarProps) { const { t } = useTranslation(); const { autoSwitchEnabled, isSettingsLoading, onToggleAutoSwitch, isAutoSwitchPending, selectedCount, totalCount, onToggleSelectAll, onForcePoll, isForcePollPending, onSyncLocal, isSyncPending, onOpenExportDialog, onOpenImportDialog, onOpenAddDialog, currentSort, sortOptions, sortI18nKeys, onSortChange, gridLayout, onLayoutChange, } = props; return (
{/* Primary Actions Group */}
{/* Secondary Actions & View Options */}
{/* Layout Toggles */}
{t('cloud.layout.auto')} {t('cloud.layout.twoCol')} {t('cloud.layout.threeCol')} {t('cloud.layout.list')} {t('cloud.layout.compact')}
{/* Sort Dropdown */} Sort By {sortOptions.map((option) => ( onSortChange(option)} > {currentSort === option ? ( ) : (
)} {t(sortI18nKeys[option])} ))} {/* More Options Dropdown */} {/* Auto-Switch Toggle embedded in menu */}
Actions {t('cloud.checkQuota')} {t('cloud.syncFromIDE')} Data {t('cloud.exportImport.export')} {t('cloud.exportImport.import')}
); }