Implement comprehensive tracking system and analytics dashboard
- Add Feeding Tracker with 3 feeding types (breast, bottle, solid) - Built-in timer for breastfeeding sessions - Recent feeding history with delete functionality - Form validation and child selection - Add Sleep Tracker with duration tracking - Start/end time inputs with "Now" quick buttons - Sleep quality and location tracking - Ongoing sleep support with real-time duration - Recent sleep activities list - Add Diaper Tracker with comprehensive monitoring - 4 diaper types (wet, dirty, both, dry) - Multiple condition selectors - Rash monitoring with severity levels - Color-coded visual indicators - Add Insights/Analytics Dashboard - Summary statistics cards (feedings, sleep, diapers) - Interactive charts using Recharts (bar, line, pie) - Date range filtering (7/30/90 days) - Activity timeline and distribution - Recent activities list - Add Settings page with backend integration - Profile update functionality with API integration - Form validation and error handling - Loading states and success notifications - Notification and appearance preferences - Add Users API service for profile management All pages include: - Full CRUD operations with backend APIs - Loading states and error handling - Form validation and user feedback - Framer Motion animations - Material-UI design system - Responsive layouts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
23
maternal-web/lib/api/users.ts
Normal file
23
maternal-web/lib/api/users.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import apiClient from './client';
|
||||
|
||||
export interface UpdateProfileData {
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export interface UserProfile {
|
||||
id: string;
|
||||
email: string;
|
||||
name: string;
|
||||
role: string;
|
||||
locale: string;
|
||||
emailVerified: boolean;
|
||||
families?: string[];
|
||||
}
|
||||
|
||||
export const usersApi = {
|
||||
// Update user profile
|
||||
updateProfile: async (data: UpdateProfileData): Promise<UserProfile> => {
|
||||
const response = await apiClient.patch('/api/v1/auth/profile', data);
|
||||
return response.data.data;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user