This commit is contained in:
ValueOn AG 2026-04-21 00:54:57 +02:00
parent 46d6ad1dfa
commit b4574b6a2e

View file

@ -11,7 +11,7 @@ import React, { useState, useEffect, useMemo, useCallback } from 'react';
import { useSearchParams } from 'react-router-dom'; import { useSearchParams } from 'react-router-dom';
import { FormGeneratorTable, ColumnConfig } from '../../components/FormGenerator/FormGeneratorTable'; import { FormGeneratorTable, ColumnConfig } from '../../components/FormGenerator/FormGeneratorTable';
import { FormGeneratorReport } from '../../components/FormGenerator/FormGeneratorReport'; import { FormGeneratorReport } from '../../components/FormGenerator/FormGeneratorReport';
import type { ReportSection, ReportFilterState, ReportChartDataPoint } from '../../components/FormGenerator/FormGeneratorReport'; import type { ReportSection, ReportFilterState, ReportChartDataPoint, ReportDateRangeSelectorConfig } from '../../components/FormGenerator/FormGeneratorReport';
import api from '../../api'; import api from '../../api';
import { useBilling, type BillingBucketSize } from '../../hooks/useBilling'; import { useBilling, type BillingBucketSize } from '../../hooks/useBilling';
import { UserTransaction } from '../../api/billingApi'; import { UserTransaction } from '../../api/billingApi';
@ -547,14 +547,14 @@ export const BillingDataView: React.FC = () => {
}, [viewStats, chartMode, t]); }, [viewStats, chartMode, t]);
// Date-range selector config: use shared PeriodPicker via FormGeneratorReport. // Date-range selector config: use shared PeriodPicker via FormGeneratorReport.
const dateRangeSelectorConfig = useMemo(() => ({ const dateRangeSelectorConfig = useMemo<ReportDateRangeSelectorConfig>(() => ({
enabled: true, enabled: true,
direction: 'past' as const, direction: 'past',
defaultPresetKind: 'thisMonth' as const, defaultPresetKind: 'thisMonth',
enabledPresets: [ enabledPresets: [
'thisMonth', 'lastMonth', 'thisQuarter', 'lastQuarter', 'thisMonth', 'lastMonth', 'thisQuarter', 'lastQuarter',
'ytd', 'lastYear', 'last12Months', 'lastN', 'custom', 'ytd', 'lastYear', 'last12Months', 'lastN', 'custom',
] as const, ],
}), []); }), []);
// Build scope options from balances (mandates the user has access to) // Build scope options from balances (mandates the user has access to)