diff --git a/frontend/src/components/BillingCycleSelector.tsx b/frontend/src/components/BillingCycleSelector.tsx index 59eaebd..9a5444d 100644 --- a/frontend/src/components/BillingCycleSelector.tsx +++ b/frontend/src/components/BillingCycleSelector.tsx @@ -26,7 +26,7 @@ export default function BillingCycleSelector({ value, onChange }: Props) { const [cycles, setCycles] = useState([]); useEffect(() => { - api.get('/transactions/cycles').then((r) => setCycles(r.data)); + api.get('/transactions/cycles').then((r) => setCycles(r.data)); }, []); const selectedKey = value ? `${value.year}-${value.month}` : 'all'; @@ -37,7 +37,7 @@ export default function BillingCycleSelector({ value, onChange }: Props) { + + setForm({ ...form, currency: v })}> + setForm({ ...form, transaction_type: v })}> + setForm({ ...form, category_id: v === 'auto' ? '' : v })} + onValueChange={(v) => setForm({ ...form, category_id: v && v !== 'auto' ? v : '' })} > @@ -201,7 +201,7 @@ export default function TransactionModal({ transaction, source, onClose, onSaved
- v && setForm({ ...form, bank: v })}> diff --git a/frontend/src/components/ui/chart.tsx b/frontend/src/components/ui/chart.tsx index 57b93a9..affb2e1 100644 --- a/frontend/src/components/ui/chart.tsx +++ b/frontend/src/components/ui/chart.tsx @@ -104,6 +104,17 @@ ${colorConfig const ChartTooltip = RechartsPrimitive.Tooltip +// recharts 3 no longer exposes the tooltip/legend content props on its public +// component types; declare the shape we actually consume. +type ChartPayloadItem = { + dataKey?: string | number + name?: string | number + value?: number | string + color?: string + type?: string + payload?: Record & { fill?: string } +} + function ChartTooltipContent({ active, payload, @@ -118,8 +129,23 @@ function ChartTooltipContent({ color, nameKey, labelKey, -}: React.ComponentProps & - React.ComponentProps<"div"> & { +}: React.ComponentProps<"div"> & { + active?: boolean + payload?: ChartPayloadItem[] + label?: string | number + labelFormatter?: ( + value: string | number, + payload: ChartPayloadItem[] + ) => React.ReactNode + labelClassName?: string + formatter?: ( + value: number | string, + name: string | number, + item: ChartPayloadItem, + index: number, + payload: unknown + ) => React.ReactNode + color?: string hideLabel?: boolean hideIndicator?: boolean indicator?: "line" | "dot" | "dashed" @@ -144,7 +170,7 @@ function ChartTooltipContent({ if (labelFormatter) { return (
- {labelFormatter(value, payload)} + {labelFormatter(value as string | number, payload)}
) } @@ -184,7 +210,7 @@ function ChartTooltipContent({ .map((item, index) => { const key = `${nameKey || item.name || item.dataKey || "value"}` const itemConfig = getPayloadConfigFromPayload(config, item, key) - const indicatorColor = color || item.payload.fill || item.color + const indicatorColor = color || item.payload?.fill || item.color return (
& - Pick & { +}: React.ComponentProps<"div"> & { + payload?: ChartPayloadItem[] + verticalAlign?: "top" | "middle" | "bottom" hideIcon?: boolean nameKey?: string }) { diff --git a/frontend/src/lib/push-notifications.ts b/frontend/src/lib/push-notifications.ts index 8f3534c..f8c7b8d 100644 --- a/frontend/src/lib/push-notifications.ts +++ b/frontend/src/lib/push-notifications.ts @@ -1,10 +1,11 @@ import api from './api'; -function urlBase64ToUint8Array(base64String: string): Uint8Array { +function urlBase64ToUint8Array(base64String: string): Uint8Array { const padding = '='.repeat((4 - (base64String.length % 4)) % 4); const base64 = (base64String + padding).replace(/-/g, '+').replace(/_/g, '/'); const rawData = window.atob(base64); - const outputArray = new Uint8Array(rawData.length); + // Explicit ArrayBuffer backing so the result satisfies BufferSource. + const outputArray = new Uint8Array(new ArrayBuffer(rawData.length)); for (let i = 0; i < rawData.length; ++i) { outputArray[i] = rawData.charCodeAt(i); }