Render milestone charts from real scan history

This commit is contained in:
2026-08-14 12:59:37 +02:00
parent 925540f3c6
commit aa3b4d02ab
4 changed files with 100 additions and 60 deletions

View File

@@ -48,7 +48,13 @@ export type SocialMilestoneCard = {
totalUniqueScans: number;
milestoneThreshold: number;
reachedAt: string;
trend: { periodDays: number; series: number[]; recentTotal: number } | null;
trend: {
points: Array<{ at: string; total: number }>;
startLabel: string;
endLabel: string;
target: number;
ceiling: number;
} | null;
};
export function socialLocale(value?: string | null): SocialLocale {
@@ -90,7 +96,7 @@ export function buildMilestoneCardSnapshot(input: {
totalUniqueScans: number;
milestoneThreshold: number;
reachedAt: Date;
trend: { periodDays: number; series: number[]; recentTotal: number } | null;
trend: SocialMilestoneCard['trend'];
locale: SocialLocale;
}): SocialMilestoneCard {
return {