(
key: keyof TransactionFilters,
value: unknown,
options?: { accounts?: Account[]; categories?: Category[] }
)
| 109 | } |
| 110 | |
| 111 | export function getFilterDisplayValue( |
| 112 | key: keyof TransactionFilters, |
| 113 | value: unknown, |
| 114 | options?: { accounts?: Account[]; categories?: Category[] } |
| 115 | ): string { |
| 116 | switch (key) { |
| 117 | case "status": |
| 118 | return value?.replace("_", " ").toLowerCase() || ""; |
| 119 | case "type": |
| 120 | return value?.toLowerCase() || ""; |
| 121 | case "accountId": |
| 122 | return ( |
| 123 | options?.accounts?.find((a) => a.id === value)?.name || value || "" |
| 124 | ); |
| 125 | case "categoryId": |
| 126 | return ( |
| 127 | options?.categories?.find((c) => c.id === value)?.name || value || "" |
| 128 | ); |
| 129 | case "startDate": |
| 130 | case "endDate": |
| 131 | return value instanceof Date ? value.toLocaleDateString() : ""; |
| 132 | case "search": |
| 133 | return value || ""; |
| 134 | default: |
| 135 | return String(value || ""); |
| 136 | } |
| 137 | } |
nothing calls this directly
no outgoing calls
no test coverage detected