Dynamically render calendar with mock data

This commit is contained in:
Bruno Bernardino
2024-03-17 14:32:47 +00:00
parent cfed77c2d4
commit 8b131d7855
3 changed files with 200 additions and 160 deletions

View File

@@ -8,14 +8,82 @@ async function getCalendars(userId: string): Promise<Pick<Calendar, 'id' | 'name
// TODO: Remove this
await new Promise((resolve) => setTimeout(() => resolve(true), 1));
return [];
return [
{
id: 'family-1',
name: 'Family',
color: 'bg-purple-500',
is_visible: true,
},
{
id: 'personal-1',
name: 'Personal',
color: 'bg-sky-600',
is_visible: true,
},
{
id: 'house-chores-1',
name: 'House Chores',
color: 'bg-red-700',
is_visible: true,
},
];
}
async function getCalendarEvents(userId: string, calendarIds: string[]): Promise<CalendarEvent[]> {
// TODO: Remove this
await new Promise((resolve) => setTimeout(() => resolve(true), 1));
return [];
return [
{
id: 'event-1',
user_id: userId,
calendar_id: 'family-1',
revision: 'fake-rev',
title: 'Dentist',
start_date: new Date('2024-03-17T14:00:00.000Z'),
end_date: new Date('2024-03-17T15:00:00.000Z'),
is_all_day: false,
status: 'scheduled',
extra: {
visibility: 'default',
},
updated_at: new Date(),
created_at: new Date(),
},
{
id: 'event-2',
user_id: userId,
calendar_id: 'personal-1',
revision: 'fake-rev',
title: 'Dermatologist',
start_date: new Date('2024-03-17T16:30:00.000Z'),
end_date: new Date('2024-03-17T17:30:00.000Z'),
is_all_day: false,
status: 'scheduled',
extra: {
visibility: 'default',
},
updated_at: new Date(),
created_at: new Date(),
},
{
id: 'event-3',
user_id: userId,
calendar_id: 'house-chores-1',
revision: 'fake-rev',
title: 'Vacuum',
start_date: new Date('2024-03-16T15:00:00.000Z'),
end_date: new Date('2024-03-16T16:00:00.000Z'),
is_all_day: false,
status: 'scheduled',
extra: {
visibility: 'default',
},
updated_at: new Date(),
created_at: new Date(),
},
];
}
interface Data {