diff --git a/app/page.tsx b/app/page.tsx index 5fb55d3..99410a0 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -68,7 +68,7 @@ export default function DashboardPage() { folders={data.folders} value={selectedAccounts} onChange={setSelectedAccounts} - className="w-[200px]" + className="w-[280px]" filteredTransactions={data.transactions} /> diff --git a/app/statistics/page.tsx b/app/statistics/page.tsx index f031af8..9e25a51 100644 --- a/app/statistics/page.tsx +++ b/app/statistics/page.tsx @@ -448,7 +448,7 @@ export default function StatisticsPage() { folders={data.folders} value={selectedAccounts} onChange={setSelectedAccounts} - className="w-[200px]" + className="w-[280px]" filteredTransactions={transactionsForAccountFilter} /> diff --git a/components/transactions/transaction-filters.tsx b/components/transactions/transaction-filters.tsx index 202ffef..ad2dbde 100644 --- a/components/transactions/transaction-filters.tsx +++ b/components/transactions/transaction-filters.tsx @@ -91,7 +91,7 @@ export function TransactionFilters({ folders={folders} value={selectedAccounts} onChange={onAccountsChange} - className="w-[200px]" + className="w-[280px]" filteredTransactions={transactionsForAccountFilter} /> diff --git a/components/ui/account-filter-combobox.tsx b/components/ui/account-filter-combobox.tsx index 5b42675..52572f6 100644 --- a/components/ui/account-filter-combobox.tsx +++ b/components/ui/account-filter-combobox.tsx @@ -19,6 +19,7 @@ import { CategoryIcon } from "@/components/ui/category-icon"; import { ChevronsUpDown, Check, Wallet, X } from "lucide-react"; import { cn } from "@/lib/utils"; import type { Account, Folder, Transaction } from "@/lib/types"; +import { accountTypeIcons } from "@/components/accounts/constants"; interface AccountFilterComboboxProps { accounts: Account[]; @@ -191,23 +192,25 @@ export function AccountFilterCombobox({ {/* Accounts in this folder */} {folderAccounts.map((account) => { const total = accountTotals[account.id]; + const AccountIcon = accountTypeIcons[account.type]; return ( handleSelect(account.id)} style={{ paddingLeft: `${paddingLeft + 16}px` }} + className="min-w-0" > - - {account.name} + + {account.name} {total !== undefined && ( - + ({formatCurrency(total)}) )} @@ -230,29 +233,32 @@ export function AccountFilterCombobox({ variant="outline" role="combobox" aria-expanded={open} - className={cn("justify-between", className)} + className={cn("justify-between min-w-0", className)} > -
+
{selectedAccounts.length === 1 ? ( <> - - {selectedAccounts[0].name} + {(() => { + const AccountIcon = accountTypeIcons[selectedAccounts[0].type]; + return ; + })()} + {selectedAccounts[0].name} ) : selectedAccounts.length > 1 ? ( <> - - + + {selectedAccounts.length} comptes ) : ( <> - - Tous les comptes + + Tous les comptes )}
-
+
{!isAll && (
e.preventDefault()} > @@ -306,22 +312,24 @@ export function AccountFilterCombobox({ {orphanAccounts.map((account) => { const total = accountTotals[account.id]; + const AccountIcon = accountTypeIcons[account.type]; return ( handleSelect(account.id)} + className="min-w-0" > - - {account.name} + + {account.name} {total !== undefined && ( - + ({formatCurrency(total)}) )} diff --git a/components/ui/category-filter-combobox.tsx b/components/ui/category-filter-combobox.tsx index 824f906..1a5dea6 100644 --- a/components/ui/category-filter-combobox.tsx +++ b/components/ui/category-filter-combobox.tsx @@ -126,21 +126,22 @@ export function CategoryFilterCombobox({ variant="outline" role="combobox" aria-expanded={open} - className={cn("justify-between", className)} + className={cn("justify-between min-w-0", className)} > -
+
{selectedCategories.length === 1 ? ( <> - {selectedCategories[0].name} + {selectedCategories[0].name} ) : selectedCategories.length > 1 ? ( <> -
+
{selectedCategories.slice(0, 3).map((cat) => (
))}
- {selectedCategories.length} catégories + {selectedCategories.length} catégories ) : isUncategorized ? ( <> - - Non catégorisé + + Non catégorisé ) : ( <> - - {getDisplayValue()} + + {getDisplayValue()} )}
-
+
{!isAll && (
e.preventDefault()} > @@ -190,17 +191,17 @@ export function CategoryFilterCombobox({ Aucune catégorie trouvée. - handleSelect("all")}> - - Toutes catégories + handleSelect("all")} className="min-w-0"> + + Toutes catégories {filteredTransactions && ( - + ({filteredTransactions.length}) )} @@ -208,17 +209,18 @@ export function CategoryFilterCombobox({ handleSelect("uncategorized")} + className="min-w-0" > - - Non catégorisé + + Non catégorisé {categoryCounts["uncategorized"] !== undefined && ( - + ({categoryCounts["uncategorized"]}) )} @@ -230,21 +232,23 @@ export function CategoryFilterCombobox({ handleSelect(parent.id)} + className="min-w-0" > - {parent.name} + {parent.name} {categoryCounts[parent.id] !== undefined && ( - + ({categoryCounts[parent.id]}) )} @@ -254,22 +258,23 @@ export function CategoryFilterCombobox({ key={child.id} value={`${parent.name} ${child.name}`} onSelect={() => handleSelect(child.id)} - className="pl-8" + className="pl-8 min-w-0" > - {child.name} + {child.name} {categoryCounts[child.id] !== undefined && ( - + ({categoryCounts[child.id]}) )}