Compute analytics timeframe dynamically
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-12 11:12:50 +01:00
parent 03bf178d61
commit dce24bb86a
3 changed files with 41 additions and 3 deletions

View File

@@ -13,7 +13,7 @@ import { MobileCard, CTAButton, KpiTile, SkeletonCard } from './components/Primi
import { getEventAnalytics, EventAnalytics } from '../api';
import { ApiError } from '../lib/apiError';
import { useAdminTheme } from './theme';
import { resolveMaxCount } from './lib/analytics';
import { resolveMaxCount, resolveTimelineHours } from './lib/analytics';
import { adminPath } from '../constants';
export default function MobileEventAnalyticsPage() {
@@ -98,7 +98,7 @@ export default function MobileEventAnalyticsPage() {
const hasTimeline = timeline.length > 0;
const hasContributors = contributors.length > 0;
const hasTasks = tasks.length > 0;
const timeframeHours = 12;
const timeframeHours = resolveTimelineHours(timeline.map((point) => point.timestamp), 12);
// Prepare chart data
const maxTimelineCount = resolveMaxCount(timeline.map((point) => point.count));