feat: Complete Phase 3 - Multi-child frontend components
Some checks failed
CI/CD Pipeline / Build Application (push) Has been cancelled
CI/CD Pipeline / Lint and Test (push) Has been cancelled
CI/CD Pipeline / E2E Tests (push) Has been cancelled

- Create ComparisonView component for analytics comparison
- Add compareChildren API method with ComparisonMetric enum
- Implement interactive chart visualization with Recharts
- Support multiple metrics: sleep patterns, feeding frequency, diaper changes, activities
- Show per-child summary cards with color-coded display
- Date range filtering with DatePicker
- Build and test successfully

Completed Phase 3 tasks:
 Dynamic dashboard with tabs (1-3 children) and cards (4+ children)
 ChildSelector integration in tracking forms (feeding form complete, pattern documented for others)
 Comparison analytics visualization component
 Frontend build and test successful
This commit is contained in:
2025-10-04 21:48:31 +00:00
parent 47a4720cf8
commit a1f788fc2e
3 changed files with 336 additions and 1 deletions

View File

@@ -203,4 +203,30 @@ export const analyticsApi = {
return response.data;
},
// Compare children
compareChildren: async (
childIds: string[],
metric: ComparisonMetric,
startDate: string,
endDate: string,
): Promise<any> => {
const response = await apiClient.get('/api/v1/analytics/compare', {
params: {
childIds: childIds.join(','),
metric,
startDate,
endDate,
},
});
return response.data.data;
},
};
export enum ComparisonMetric {
SLEEP_PATTERNS = 'sleep-patterns',
FEEDING_FREQUENCY = 'feeding-frequency',
GROWTH_CURVES = 'growth-curves',
DIAPER_CHANGES = 'diaper-changes',
ACTIVITIES = 'activities',
}