@umituz/web-dashboard 11.6.1 → 11.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,51 +1,8 @@
1
- import type { ReactNode } from 'react';
2
-
3
- export type CalendarTone = 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'neutral' | 'accent';
4
-
5
- export type CalendarScreenView = 'month' | 'week' | 'day' | 'agenda';
6
-
7
- export interface CalendarItem {
8
- id: string;
9
- dayKey: string;
10
- startMin?: number;
11
- endMin?: number;
12
- title: ReactNode;
13
- tone?: CalendarTone;
14
- icon?: ReactNode;
15
- meta?: ReactNode;
16
- kind?: string;
17
- muted?: boolean;
18
- payload?: unknown;
19
- resourceId?: string;
20
- }
21
-
22
- export interface CalendarLegendEntry {
23
- tone: CalendarTone;
24
- label: string;
25
- }
26
-
27
- export interface CalendarLabels {
28
- today: string;
29
- previous: string;
30
- next: string;
31
- month: string;
32
- week: string;
33
- day: string;
34
- agenda: string;
35
- allDay: string;
36
- more: string;
37
- emptyDay: string;
38
- }
39
-
40
- export const DEFAULT_CALENDAR_LABELS: CalendarLabels = {
41
- today: 'Today',
42
- previous: 'Previous',
43
- next: 'Next',
44
- month: 'Month',
45
- week: 'Week',
46
- day: 'Day',
47
- agenda: 'Agenda',
48
- allDay: 'All day',
49
- more: '+{count} more',
50
- emptyDay: 'Nothing scheduled',
51
- };
1
+ export type {
2
+ CalendarTone,
3
+ CalendarScreenView,
4
+ CalendarItem,
5
+ CalendarLegendEntry,
6
+ CalendarLabels,
7
+ } from '@umituz/web-design-system/organisms';
8
+ export { DEFAULT_CALENDAR_LABELS } from '@umituz/web-design-system/organisms';
@@ -1,221 +1,31 @@
1
- import type { CalendarItem } from '../types/view.types';
2
-
3
- export const DAY_MINUTES = 24 * 60;
4
- export const DEFAULT_DAY_START_MIN = 7 * 60;
5
- export const DEFAULT_DAY_END_MIN = 21 * 60;
6
- export const DEFAULT_MAX_PER_DAY = 3;
7
- export const SLOT_QUANTUM_MIN = 30;
8
-
9
- function pad(value: number): string {
10
- return String(value).padStart(2, '0');
11
- }
12
-
13
- export function parseDayKey(dayKey: string): Date {
14
- const [year, month, day] = dayKey.split('-').map(Number);
15
- return new Date(year ?? 1970, (month ?? 1) - 1, day ?? 1);
16
- }
17
-
18
- export function toDayKey(date: Date): string {
19
- return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
20
- }
21
-
22
- export function todayKey(): string {
23
- return toDayKey(new Date());
24
- }
25
-
26
- export function addDaysKey(dayKey: string, days: number): string {
27
- const date = parseDayKey(dayKey);
28
- date.setDate(date.getDate() + days);
29
- return toDayKey(date);
30
- }
31
-
32
- export function addMonthsKey(dayKey: string, months: number): string {
33
- const date = parseDayKey(dayKey);
34
- const dayOfMonth = date.getDate();
35
- date.setDate(1);
36
- date.setMonth(date.getMonth() + months);
37
- const lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();
38
- date.setDate(Math.min(dayOfMonth, lastDay));
39
- return toDayKey(date);
40
- }
41
-
42
- export function startOfWeekKey(dayKey: string, weekStartsOn: 0 | 1 = 1): string {
43
- const back = (parseDayKey(dayKey).getDay() + 7 - weekStartsOn) % 7;
44
- return addDaysKey(dayKey, -back);
45
- }
46
-
47
- export function weekDays(anchorKey: string, weekStartsOn: 0 | 1 = 1): string[] {
48
- const start = startOfWeekKey(anchorKey, weekStartsOn);
49
- return Array.from({ length: 7 }, (_, index) => addDaysKey(start, index));
50
- }
51
-
52
- export function monthMatrix(anchorKey: string, weekStartsOn: 0 | 1 = 1): string[] {
53
- const firstOfMonth = `${anchorKey.slice(0, 7)}-01`;
54
- const start = startOfWeekKey(firstOfMonth, weekStartsOn);
55
- return Array.from({ length: 42 }, (_, index) => addDaysKey(start, index));
56
- }
57
-
58
- export function sameMonth(firstKey: string, secondKey: string): boolean {
59
- return firstKey.slice(0, 7) === secondKey.slice(0, 7);
60
- }
61
-
62
- export function formatWeekdayShort(dayKey: string, locale = 'en-US'): string {
63
- return parseDayKey(dayKey).toLocaleDateString(locale, { weekday: 'short' });
64
- }
65
-
66
- export function formatDayNumber(dayKey: string): string {
67
- return String(Number(dayKey.slice(8)));
68
- }
69
-
70
- export function formatMonthTitle(anchorKey: string, locale = 'en-US'): string {
71
- return parseDayKey(anchorKey).toLocaleDateString(locale, { month: 'long', year: 'numeric' });
72
- }
73
-
74
- export function formatWeekTitle(anchorKey: string, locale = 'en-US'): string {
75
- const days = weekDays(anchorKey);
76
- const first = parseDayKey(days[0] ?? anchorKey);
77
- const last = parseDayKey(days[6] ?? anchorKey);
78
- const left = first.toLocaleDateString(locale, { month: 'short', day: 'numeric' });
79
- const rightOptions: Intl.DateTimeFormatOptions =
80
- first.getMonth() === last.getMonth()
81
- ? { day: 'numeric', year: 'numeric' }
82
- : { month: 'short', day: 'numeric', year: 'numeric' };
83
- return `${left} – ${last.toLocaleDateString(locale, rightOptions)}`;
84
- }
85
-
86
- export function formatDayTitle(dayKey: string, locale = 'en-US'): string {
87
- return parseDayKey(dayKey).toLocaleDateString(locale, {
88
- weekday: 'long',
89
- month: 'long',
90
- day: 'numeric',
91
- year: 'numeric',
92
- });
93
- }
94
-
95
- export function formatAgendaTitle(anchorKey: string, days: number, locale = 'en-US'): string {
96
- const span = Math.max(days - 1, 0);
97
- const from = parseDayKey(anchorKey).toLocaleDateString(locale, { month: 'short', day: 'numeric' });
98
- const to = parseDayKey(addDaysKey(anchorKey, span)).toLocaleDateString(locale, {
99
- month: 'short',
100
- day: 'numeric',
101
- year: 'numeric',
102
- });
103
- return `${from} – ${to}`;
104
- }
105
-
106
- export function minutesToLabel(minutes: number): string {
107
- const normalized = ((Math.round(minutes) % DAY_MINUTES) + DAY_MINUTES) % DAY_MINUTES;
108
- return `${pad(Math.floor(normalized / 60))}:${pad(normalized % 60)}`;
109
- }
110
-
111
- export interface CalendarSpan {
112
- startMin: number;
113
- endMin: number;
114
- }
115
-
116
- export function itemSpan(item: CalendarItem): CalendarSpan {
117
- const startMin = item.startMin ?? 0;
118
- const endMin = item.endMin ?? Math.min(startMin + 60, DAY_MINUTES);
119
- return { startMin, endMin: Math.max(endMin, startMin) };
120
- }
121
-
122
- export function spansOverlap(first: CalendarSpan, second: CalendarSpan): boolean {
123
- return first.startMin < second.endMin && second.startMin < first.endMin;
124
- }
125
-
126
- export function findConflicts<T extends CalendarItem>(items: readonly T[]): T[] {
127
- const sorted = [...items]
128
- .map((item) => ({ item, span: itemSpan(item) }))
129
- .sort((first, second) => first.span.startMin - second.span.startMin);
130
- const conflicted = new Set<string>();
131
- for (let index = 0; index < sorted.length; index += 1) {
132
- for (let other = index + 1; other < sorted.length; other += 1) {
133
- if (sorted[other]!.span.startMin >= sorted[index]!.span.endMin) break;
134
- conflicted.add(sorted[index]!.item.id);
135
- conflicted.add(sorted[other]!.item.id);
136
- }
137
- }
138
- return items.filter((item) => conflicted.has(item.id));
139
- }
140
-
141
- export interface PositionedItem<T extends CalendarItem> {
142
- item: T;
143
- column: number;
144
- columns: number;
145
- }
146
-
147
- export function layoutColumns<T extends CalendarItem>(items: readonly T[]): PositionedItem<T>[] {
148
- const sorted = [...items].sort((first, second) => {
149
- const firstSpan = itemSpan(first);
150
- const secondSpan = itemSpan(second);
151
- return firstSpan.startMin === secondSpan.startMin
152
- ? secondSpan.endMin - firstSpan.endMin
153
- : firstSpan.startMin - secondSpan.startMin;
154
- });
155
-
156
- const placed: PositionedItem<T>[] = [];
157
- let cluster: PositionedItem<T>[] = [];
158
- let clusterEnd = -1;
159
-
160
- const flush = () => {
161
- for (const entry of cluster) entry.columns = cluster.length;
162
- placed.push(...cluster);
163
- cluster = [];
164
- clusterEnd = -1;
165
- };
166
-
167
- for (const item of sorted) {
168
- const span = itemSpan(item);
169
- if (cluster.length > 0 && span.startMin >= clusterEnd) flush();
170
- clusterEnd = Math.max(clusterEnd, span.endMin);
171
- const column = cluster.findIndex((entry) => itemSpan(entry.item).endMin <= span.startMin);
172
- cluster.push({ item, column: column === -1 ? cluster.length : column, columns: 1 });
173
- }
174
- flush();
175
- return placed;
176
- }
177
-
178
- export function eventGeometry(
179
- item: CalendarItem,
180
- dayStartMin: number,
181
- dayEndMin: number,
182
- ): { top: number; height: number } {
183
- const span = itemSpan(item);
184
- const total = Math.max(dayEndMin - dayStartMin, 1);
185
- const start = (span.startMin - dayStartMin) / total;
186
- const end = Math.min((span.endMin - dayStartMin) / total, 1);
187
- const clampedStart = Math.max(start, 0);
188
- return { top: clampedStart * 100, height: Math.max(end - clampedStart, 0.012) * 100 };
189
- }
190
-
191
- export interface DaySlot {
192
- startMin: number;
193
- endMin: number;
194
- taken: boolean;
195
- }
196
-
197
- export function generateDaySlots(
198
- options: { startMin: number; endMin: number; durationMin: number; stepMin?: number },
199
- booked: readonly CalendarSpan[] = [],
200
- ): DaySlot[] {
201
- const step = options.stepMin ?? options.durationMin;
202
- const slots: DaySlot[] = [];
203
- for (let start = options.startMin; start + options.durationMin <= options.endMin; start += step) {
204
- const slot = { startMin: start, endMin: start + options.durationMin };
205
- slots.push({ ...slot, taken: booked.some((span) => spansOverlap(slot, span)) });
206
- }
207
- return slots;
208
- }
209
-
210
- export function groupByDayKey<T extends CalendarItem>(items: readonly T[]): Map<string, T[]> {
211
- const map = new Map<string, T[]>();
212
- for (const item of items) {
213
- const bucket = map.get(item.dayKey);
214
- if (bucket) bucket.push(item);
215
- else map.set(item.dayKey, [item]);
216
- }
217
- for (const bucket of map.values()) {
218
- bucket.sort((first, second) => itemSpan(first).startMin - itemSpan(second).startMin);
219
- }
220
- return map;
221
- }
1
+ export {
2
+ DAY_MINUTES,
3
+ DEFAULT_DAY_START_MIN,
4
+ DEFAULT_DAY_END_MIN,
5
+ DEFAULT_MAX_PER_DAY,
6
+ SLOT_QUANTUM_MIN,
7
+ parseDayKey,
8
+ toDayKey,
9
+ todayKey,
10
+ addDaysKey,
11
+ addMonthsKey,
12
+ startOfWeekKey,
13
+ weekDays,
14
+ monthMatrix,
15
+ sameMonth,
16
+ formatWeekdayShort,
17
+ formatDayNumber,
18
+ formatMonthTitle,
19
+ formatWeekTitle,
20
+ formatDayTitle,
21
+ formatAgendaTitle,
22
+ minutesToLabel,
23
+ itemSpan,
24
+ spansOverlap,
25
+ findConflicts,
26
+ layoutColumns,
27
+ eventGeometry,
28
+ generateDaySlots,
29
+ groupByDayKey,
30
+ } from '@umituz/web-design-system/organisms';
31
+ export type { CalendarSpan, DaySlot, PositionedItem } from '@umituz/web-design-system/organisms';
@@ -1,106 +0,0 @@
1
- import { describe, expect, it, vi } from 'vitest';
2
- import { fireEvent, render, screen } from '@testing-library/react';
3
- import { Calendar } from './Calendar';
4
- import type { CalendarItem } from '../types/view.types';
5
-
6
- const item = (id: string, dayKey: string, startMin?: number, endMin?: number): CalendarItem => ({
7
- id,
8
- dayKey,
9
- startMin,
10
- endMin,
11
- title: id,
12
- });
13
-
14
- const mount = (props: Partial<Parameters<typeof Calendar>[0]> = {}) =>
15
- render(
16
- <Calendar
17
- items={[item('Kickoff', '2026-03-15', 600, 660)]}
18
- cursor="2026-03-10"
19
- {...props}
20
- />,
21
- );
22
-
23
- describe('Calendar', () => {
24
- it('renders the month grid with a localized title by default', () => {
25
- const { container } = mount();
26
- expect(screen.getByText('March 2026')).toBeTruthy();
27
- expect(container.querySelectorAll('[role="gridcell"]')).toHaveLength(42);
28
- });
29
-
30
- it('switches to a seven-lane week grid and a single day grid', () => {
31
- mount();
32
- fireEvent.click(screen.getByText('Week'));
33
- expect(screen.getByRole('region', { name: '2026-03-15' })).toBeTruthy();
34
- fireEvent.click(screen.getByText('Day'));
35
- expect(screen.getByText('Tuesday, March 10, 2026')).toBeTruthy();
36
- });
37
-
38
- it('drills from a month cell into the day view', () => {
39
- const onSelectDay = vi.fn();
40
- render(
41
- <Calendar
42
- items={[item('Kickoff', '2026-03-15', 600, 660)]}
43
- initialCursor="2026-03-10"
44
- onSelectDay={onSelectDay}
45
- />,
46
- );
47
- fireEvent.click(screen.getByRole('button', { name: '2026-03-15' }));
48
- expect(onSelectDay).toHaveBeenCalledWith('2026-03-15');
49
- expect(screen.getByText('Sunday, March 15, 2026')).toBeTruthy();
50
- });
51
-
52
- it('stays in the month view when the day view is not offered', () => {
53
- render(
54
- <Calendar
55
- items={[{ id: 'Expiry', dayKey: '2026-03-15', title: 'Expiry' }]}
56
- initialCursor="2026-03-10"
57
- views={['month', 'agenda']}
58
- />,
59
- );
60
- fireEvent.click(screen.getByRole('button', { name: '2026-03-15' }));
61
- expect(screen.getByText('March 2026')).toBeTruthy();
62
- });
63
-
64
- it('respects a controlled view', () => {
65
- mount({ view: 'day' });
66
- expect(screen.getByText('Tuesday, March 10, 2026')).toBeTruthy();
67
- });
68
-
69
- it('reports view changes', () => {
70
- const onViewChange = vi.fn();
71
- mount({ onViewChange });
72
- fireEvent.click(screen.getByText('Week'));
73
- expect(onViewChange).toHaveBeenCalledWith('week');
74
- });
75
-
76
- it('renders the legend', () => {
77
- mount({ legend: [{ tone: 'success', label: 'Confirmed' }] });
78
- expect(screen.getByText('Confirmed')).toBeTruthy();
79
- });
80
-
81
- it('renders toolbar extras inside the toolbar', () => {
82
- mount({ toolbarExtra: <span className="calendar-count">4 appointments</span> });
83
- const extra = screen.getByText('4 appointments').closest('.udb-cal-extra');
84
- expect(extra).toBeTruthy();
85
- });
86
-
87
- it('switches to the agenda view with a window title', () => {
88
- mount({ views: ['month', 'agenda'] });
89
- fireEvent.click(screen.getByText('Agenda'));
90
- expect(screen.getByText('Mar 10 – Apr 8, 2026')).toBeTruthy();
91
- expect(screen.getByRole('button', { name: /Kickoff/ })).toBeTruthy();
92
- });
93
-
94
- it('shifts the agenda window by agendaDays', () => {
95
- render(
96
- <Calendar
97
- items={[item('Kickoff', '2026-03-15', 600, 660)]}
98
- initialCursor="2026-03-10"
99
- views={['agenda']}
100
- agendaDays={30}
101
- />,
102
- );
103
- fireEvent.click(screen.getByRole('button', { name: 'Next' }));
104
- expect(screen.getByText('Apr 9 – May 8, 2026')).toBeTruthy();
105
- });
106
- });
@@ -1,211 +0,0 @@
1
- import { useMemo, useState } from 'react';
2
- import type { ReactNode } from 'react';
3
- import { ChevronLeft, ChevronRight } from 'lucide-react';
4
- import { Button, IconButton } from '@umituz/web-design-system/atoms';
5
- import { Segmented } from '@umituz/web-design-system/molecules';
6
- import {
7
- DEFAULT_CALENDAR_LABELS,
8
- type CalendarItem,
9
- type CalendarLabels,
10
- type CalendarLegendEntry,
11
- type CalendarScreenView,
12
- } from '../types/view.types';
13
- import {
14
- DEFAULT_DAY_END_MIN,
15
- DEFAULT_DAY_START_MIN,
16
- DEFAULT_MAX_PER_DAY,
17
- addDaysKey,
18
- addMonthsKey,
19
- formatAgendaTitle,
20
- formatDayTitle,
21
- formatMonthTitle,
22
- formatWeekTitle,
23
- todayKey,
24
- weekDays,
25
- } from '../utils/layout';
26
- import { CalendarAgenda } from './CalendarAgenda';
27
- import { CalendarMonth } from './CalendarMonth';
28
- import { CalendarTimeGrid } from './CalendarTimeGrid';
29
-
30
- export interface CalendarProps {
31
- items: readonly CalendarItem[];
32
- view?: CalendarScreenView;
33
- onViewChange?: (view: CalendarScreenView) => void;
34
- cursor?: string;
35
- initialCursor?: string;
36
- onCursorChange?: (dayKey: string) => void;
37
- views?: readonly CalendarScreenView[];
38
- weekStartsOn?: 0 | 1;
39
- dayStartMin?: number;
40
- dayEndMin?: number;
41
- maxPerDay?: number;
42
- agendaDays?: number;
43
- locale?: string;
44
- labels?: Partial<CalendarLabels>;
45
- legend?: readonly CalendarLegendEntry[];
46
- toolbarExtra?: ReactNode;
47
- emptyState?: ReactNode;
48
- onSelectItem?: (item: CalendarItem) => void;
49
- onSelectDay?: (dayKey: string) => void;
50
- onSlotClick?: (dayKey: string, minutes: number) => void;
51
- className?: string;
52
- }
53
-
54
- export const Calendar = ({
55
- items,
56
- view,
57
- onViewChange,
58
- cursor,
59
- initialCursor,
60
- onCursorChange,
61
- views = ['month', 'week', 'day'],
62
- weekStartsOn = 1,
63
- dayStartMin = DEFAULT_DAY_START_MIN,
64
- dayEndMin = DEFAULT_DAY_END_MIN,
65
- maxPerDay = DEFAULT_MAX_PER_DAY,
66
- agendaDays = 30,
67
- locale = 'en-US',
68
- labels,
69
- legend,
70
- toolbarExtra,
71
- emptyState,
72
- onSelectItem,
73
- onSelectDay,
74
- onSlotClick,
75
- className,
76
- }: CalendarProps) => {
77
- const text = { ...DEFAULT_CALENDAR_LABELS, ...labels };
78
- const [innerView, setInnerView] = useState<CalendarScreenView>(views[0] ?? 'month');
79
- const [innerCursor, setInnerCursor] = useState(() => cursor ?? initialCursor ?? todayKey());
80
- const activeView = view ?? innerView;
81
- const activeCursor = cursor ?? innerCursor;
82
-
83
- const applyView = (next: CalendarScreenView) => {
84
- setInnerView(next);
85
- onViewChange?.(next);
86
- };
87
-
88
- const applyCursor = (next: string) => {
89
- setInnerCursor(next);
90
- onCursorChange?.(next);
91
- };
92
-
93
- const shift = (direction: number) => {
94
- if (activeView === 'month') applyCursor(addMonthsKey(activeCursor, direction));
95
- else if (activeView === 'week') applyCursor(addDaysKey(activeCursor, direction * 7));
96
- else if (activeView === 'agenda') applyCursor(addDaysKey(activeCursor, direction * agendaDays));
97
- else applyCursor(addDaysKey(activeCursor, direction));
98
- };
99
-
100
- const title = useMemo(() => {
101
- if (activeView === 'day') return formatDayTitle(activeCursor, locale);
102
- if (activeView === 'week') return formatWeekTitle(activeCursor, locale);
103
- if (activeView === 'agenda') return formatAgendaTitle(activeCursor, agendaDays, locale);
104
- return formatMonthTitle(activeCursor, locale);
105
- }, [activeView, activeCursor, agendaDays, locale]);
106
-
107
- const handleSelectDay = (dayKey: string) => {
108
- applyCursor(dayKey);
109
- if (activeView !== 'day' && views.includes('day')) applyView('day');
110
- onSelectDay?.(dayKey);
111
- };
112
-
113
- return (
114
- <div className={className ? `udb-cal ${className}` : 'udb-cal'}>
115
- <div className="udb-cal-toolbar">
116
- <div className="udb-cal-toolbar-nav">
117
- <IconButton
118
- icon={<ChevronLeft size={16} />}
119
- label={text.previous}
120
- size="sm"
121
- variant="outline"
122
- onClick={() => shift(-1)}
123
- />
124
- <IconButton
125
- icon={<ChevronRight size={16} />}
126
- label={text.next}
127
- size="sm"
128
- variant="outline"
129
- onClick={() => shift(1)}
130
- />
131
- <span className="udb-cal-title">{title}</span>
132
- <Button variant="ghost" size="sm" onClick={() => applyCursor(todayKey())}>
133
- {text.today}
134
- </Button>
135
- </div>
136
- <div className="udb-cal-toolbar-side">
137
- {toolbarExtra && <div className="udb-cal-extra">{toolbarExtra}</div>}
138
- {legend && legend.length > 0 && (
139
- <div className="udb-cal-legend">
140
- {legend.map((entry) => (
141
- <span className="udb-cal-legend-entry" key={entry.tone + entry.label}>
142
- <span className={`udb-cal-legend-dot udb-cal-dot--${entry.tone}`} />
143
- {entry.label}
144
- </span>
145
- ))}
146
- </div>
147
- )}
148
- <Segmented
149
- options={views.map((option) => ({ value: option, label: text[option] }))}
150
- value={activeView}
151
- onChange={(next) => applyView(next)}
152
- aria-label={text.month}
153
- />
154
- </div>
155
- </div>
156
-
157
- {activeView === 'month' && (
158
- <CalendarMonth
159
- items={items}
160
- anchorKey={activeCursor}
161
- weekStartsOn={weekStartsOn}
162
- locale={locale}
163
- maxPerDay={maxPerDay}
164
- labels={labels}
165
- onSelectDay={handleSelectDay}
166
- onSelectItem={onSelectItem}
167
- />
168
- )}
169
-
170
- {activeView === 'week' && (
171
- <CalendarTimeGrid
172
- items={items}
173
- days={weekDays(activeCursor, weekStartsOn)}
174
- dayStartMin={dayStartMin}
175
- dayEndMin={dayEndMin}
176
- locale={locale}
177
- labels={labels}
178
- emptyState={emptyState}
179
- onSelectItem={onSelectItem}
180
- onSlotClick={onSlotClick}
181
- />
182
- )}
183
-
184
- {activeView === 'day' && (
185
- <CalendarTimeGrid
186
- items={items}
187
- days={[activeCursor]}
188
- dayStartMin={dayStartMin}
189
- dayEndMin={dayEndMin}
190
- locale={locale}
191
- labels={labels}
192
- emptyState={emptyState}
193
- onSelectItem={onSelectItem}
194
- onSlotClick={onSlotClick}
195
- />
196
- )}
197
-
198
- {activeView === 'agenda' && (
199
- <CalendarAgenda
200
- items={items}
201
- anchorKey={activeCursor}
202
- agendaDays={agendaDays}
203
- locale={locale}
204
- labels={labels}
205
- emptyState={emptyState}
206
- onSelectItem={onSelectItem}
207
- />
208
- )}
209
- </div>
210
- );
211
- };