@jsb188/calendar 1.1.10

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.
@@ -0,0 +1,122 @@
1
+ import type { CalendarViewEnum } from '../constants/calendar.ts';
2
+
3
+ /**
4
+ * Calendar surface types.
5
+ *
6
+ * These describe what the calendar draws, which is deliberately narrower than
7
+ * what the schedule API returns: the grid needs a title, a time range, and a
8
+ * few flags, and nothing it renders should depend on the full server shape.
9
+ * Keeping the boundary here is what lets the same grid draw a daycare shift,
10
+ * an off-site, and a network event.
11
+ */
12
+
13
+ /**
14
+ * One entry as the grid understands it. Times are real instants; the grid
15
+ * converts them into the calendar's display zone once, at layout time.
16
+ */
17
+
18
+ export interface CalendarEventObj {
19
+ id: string;
20
+ calendarId: string;
21
+ title: string;
22
+ startAt: Date;
23
+ endAt: Date;
24
+ allDay: boolean;
25
+ // SHIFT | EVENT | BLOCK — a BLOCK is drawn as unavailability, not staffing
26
+ kind: string;
27
+ // DRAFT | PUBLISHED | CANCELED
28
+ status: string;
29
+ location?: string | null;
30
+ note?: string | null;
31
+ color?: string | null;
32
+ // Everyone working this entry, for the assignee chips and "my calendar only"
33
+ assigneeAccountIds: string[];
34
+ // How many people the entry still needs; drives the "open shift" treatment
35
+ openCount?: number;
36
+ // Set when the viewer is one of the assignees, so the grid can mark it
37
+ // without re-deriving the answer for every event on every render
38
+ isMine?: boolean;
39
+ }
40
+
41
+ /**
42
+ * One event placed in the time grid: the vertical extent in minutes from the
43
+ * top of its day, plus the horizontal share it takes of that day's column.
44
+ */
45
+
46
+ export interface CalendarEventLayoutObj {
47
+ event: CalendarEventObj;
48
+ // Index of the day column this segment belongs to
49
+ dayIndex: number;
50
+ // Minutes from local midnight; the grid multiplies by the hour height
51
+ startMinute: number;
52
+ endMinute: number;
53
+ // Fractions of the day column's width, 0..1
54
+ left: number;
55
+ width: number;
56
+ // Which overlap column this took, and how many there were, so a stacked
57
+ // layout can raise the one in front
58
+ column: number;
59
+ columnCount: number;
60
+ // True when this is the continuation of an entry that began on an earlier
61
+ // day, so the grid can round only the corners that are really ends
62
+ continuesFromPreviousDay: boolean;
63
+ continuesToNextDay: boolean;
64
+ }
65
+
66
+ /**
67
+ * One day in a rendered range, resolved in the calendar's display zone.
68
+ */
69
+
70
+ export interface CalendarDayObj {
71
+ // Local calendar date, "yyyy-MM-dd", stable across zones
72
+ dateKey: string;
73
+ // Local midnight of this day as an instant
74
+ startAt: Date;
75
+ endAt: Date;
76
+ isToday: boolean;
77
+ isWeekend: boolean;
78
+ // False for the leading and trailing days of a month grid
79
+ isInPrimaryRange: boolean;
80
+ }
81
+
82
+ /**
83
+ * The window a view is currently showing, plus the days inside it.
84
+ */
85
+
86
+ export interface CalendarRangeObj {
87
+ view: CalendarViewEnum;
88
+ // The date the view is anchored to; what "next" and "previous" move
89
+ anchorDate: Date;
90
+ // The instants to query — a month view's range covers its leading and
91
+ // trailing days too, because they are drawn
92
+ from: Date;
93
+ to: Date;
94
+ days: CalendarDayObj[];
95
+ timeZone: string;
96
+ }
97
+
98
+ /**
99
+ * A time range the user is drawing or has selected, in the grid.
100
+ */
101
+
102
+ export interface CalendarSelectionObj {
103
+ startAt: Date;
104
+ endAt: Date;
105
+ allDay: boolean;
106
+ // Which calendar a new entry would be created on
107
+ calendarId: string | null;
108
+ }
109
+
110
+ /**
111
+ * One calendar in the overlay list, with the viewer's toggle state.
112
+ */
113
+
114
+ export interface CalendarSourceObj {
115
+ id: string;
116
+ name: string;
117
+ color: string | null;
118
+ kind: string;
119
+ // COVERAGE calendars run the constraint engine and get the coverage board
120
+ canEdit: boolean;
121
+ visible: boolean;
122
+ }
@@ -0,0 +1,86 @@
1
+ import { cn } from '@jsb188/app/utils/string.ts';
2
+ import { memo } from 'react';
3
+ import { CALENDAR_DRAFT_PATTERN_CLASS_NAME } from '../constants/calendar.ts';
4
+ import type { CalendarEventObj } from '../types/calendar.d.ts';
5
+
6
+ /**
7
+ * The agenda ("Schedule") list.
8
+ *
9
+ * Runs FORWARD from its anchor rather than around it: a worker opening this
10
+ * wants what is coming, not what they already worked. Days with nothing on
11
+ * them are omitted entirely — a month of empty headings is scrolling, not
12
+ * information — but the whole list being empty is called out explicitly, so an
13
+ * empty agenda never reads as a failed load.
14
+ */
15
+
16
+ export interface CalendarAgendaDayObj {
17
+ dateKey: string;
18
+ // Localized, e.g. "Wed, Jul 22"
19
+ label: string;
20
+ isToday: boolean;
21
+ events: CalendarEventObj[];
22
+ }
23
+
24
+ export interface CalendarAgendaUIProps {
25
+ days: CalendarAgendaDayObj[];
26
+ selectedEventId: string | null;
27
+ // Formatted time range per event id, or the all-day word
28
+ timeLabelByEventId: Map<string, string>;
29
+ emptyText: string;
30
+ onSelectEvent: (eventId: string) => void;
31
+ }
32
+
33
+ export const CalendarAgendaUI = memo((p: CalendarAgendaUIProps) => {
34
+ const { days, selectedEventId, timeLabelByEventId, emptyText, onSelectEvent } = p;
35
+
36
+ if (!days.length) {
37
+ return (
38
+ <div className='f h_0 v_center a_c'>
39
+ <span className='ft_sm cl_lt'>{emptyText}</span>
40
+ </div>
41
+ );
42
+ }
43
+
44
+ return (
45
+ <div className='f h_0 app_scr auto_y'>
46
+ {days.map((day) => (
47
+ <div key={day.dateKey} className='bd_t_1 bd_t_bd'>
48
+ <div
49
+ className={cn('ft_tn', day.isToday ? 'ft_bold' : 'cl_lt')}
50
+ style={{ paddingLeft: 12, paddingRight: 12, paddingTop: 6, paddingBottom: 2 }}
51
+ >
52
+ {day.label}
53
+ </div>
54
+
55
+ {day.events.map((event) => (
56
+ <button
57
+ key={`${day.dateKey}:${event.id}`}
58
+ type='button'
59
+ className={cn(
60
+ 'w_f a_l h_item gap_sm',
61
+ event.status === 'CANCELED' ? 'strikethrough' : '',
62
+ selectedEventId === event.id ? 'bg_active' : '',
63
+ )}
64
+ style={{ paddingLeft: 12, paddingRight: 12, paddingTop: 4, paddingBottom: 4 }}
65
+ onClick={() => onSelectEvent(event.id)}
66
+ >
67
+ <span
68
+ className={cn(
69
+ 'no_shrink ft_tn cl_lt rel of',
70
+ event.status === 'DRAFT' ? CALENDAR_DRAFT_PATTERN_CLASS_NAME : '',
71
+ )}
72
+ style={{ width: 104 }}
73
+ >
74
+ {timeLabelByEventId.get(event.id) || ''}
75
+ </span>
76
+
77
+ <span className='f ellip ft_sm'>{event.title}</span>
78
+
79
+ {event.isMine ? <span className='no_shrink ft_tn cl_lt'>•</span> : null}
80
+ </button>
81
+ ))}
82
+ </div>
83
+ ))}
84
+ </div>
85
+ );
86
+ });
@@ -0,0 +1,199 @@
1
+ import { cn } from '@jsb188/app/utils/string.ts';
2
+ import { memo } from 'react';
3
+ import { CALENDAR_DRAFT_PATTERN_CLASS_NAME } from '../constants/calendar.ts';
4
+
5
+ /**
6
+ * The coverage board.
7
+ *
8
+ * A manager staffing a week does not want a list of shifts, they want the one
9
+ * question answered everywhere at once: where am I short? So this is a matrix
10
+ * — resources down, time buckets across — and every cell says the same two
11
+ * numbers, "how many are on" over "how many are needed".
12
+ *
13
+ * Three things it deliberately does NOT do:
14
+ *
15
+ * - **It does not compute anything.** Buckets, counts, shortfalls, severities
16
+ * and every label arrive as props. The same board draws an hour-by-hour day
17
+ * and a day-by-day month purely by being handed different buckets.
18
+ *
19
+ * - **It does not hide a fully-staffed cell.** A blank grid with a few red
20
+ * squares reads as "loading"; a full grid with a few red squares reads as
21
+ * "checked, and here is the problem".
22
+ *
23
+ * - **It does not fold draft into published.** Unpublished coverage is drawn
24
+ * with the same stripe pattern the grid uses for draft entries, so nobody
25
+ * counts staff who have not actually been told they are working.
26
+ */
27
+
28
+ /**
29
+ * One column: a slice of the visible window.
30
+ */
31
+
32
+ export interface CalendarCoverageBucketObj {
33
+ key: string;
34
+ // Localized column heading, e.g. "8a" or "Mon"
35
+ label: string;
36
+ // Optional second heading line, e.g. the date under the weekday
37
+ subLabel?: string | null;
38
+ // Outside the operating window — drawn dimmer, because being "short" in a
39
+ // bucket nobody operates in is not a fact worth alarming anyone with
40
+ isMuted?: boolean;
41
+ }
42
+
43
+ /**
44
+ * One resource × one bucket.
45
+ */
46
+
47
+ export interface CalendarCoverageCellObj {
48
+ key: string;
49
+ bucketKey: string;
50
+ required: number;
51
+ actual: number;
52
+ // Nothing at all is scheduled here; drawn blank rather than as "0/0"
53
+ isEmpty?: boolean;
54
+ // Every occurrence behind this cell is still unpublished
55
+ isDraft?: boolean;
56
+ // The violation strip's entry this cell belongs to, when there is one
57
+ violationKey?: string | null;
58
+ // BLOCK | WARN | null — decides red versus amber when the cell is short
59
+ severity?: string | null;
60
+ }
61
+
62
+ /**
63
+ * One row: a room, a position, a vehicle — whatever this calendar staffs.
64
+ */
65
+
66
+ export interface CalendarCoverageRowObj {
67
+ resourceId: string;
68
+ name: string;
69
+ // Optional second line under the name, e.g. a location or a capacity
70
+ subName?: string | null;
71
+ // Aligned index-for-index with `buckets`
72
+ cells: CalendarCoverageCellObj[];
73
+ }
74
+
75
+ export interface CalendarCoverageUIProps {
76
+ rows: CalendarCoverageRowObj[];
77
+ buckets: CalendarCoverageBucketObj[];
78
+ // Heading of the left-hand column, e.g. "Resource"
79
+ resourceHeaderText: string;
80
+ emptyText: string;
81
+ // Formats a cell, e.g. "2/3". The package holds no copy, so even the
82
+ // separator is the caller's decision
83
+ countText: (actual: number, required: number) => string;
84
+ // Geometry, in px. The caller sizes the board to its container and to how
85
+ // many buckets the window produced
86
+ resourceColumnWidth?: number;
87
+ bucketWidth?: number;
88
+ rowHeight?: number;
89
+ // Highlights every cell belonging to the violation the strip has selected
90
+ selectedViolationKey?: string | null;
91
+ onSelectCell?: (resourceId: string, cell: CalendarCoverageCellObj) => void;
92
+ }
93
+
94
+ export const CalendarCoverageUI = memo((p: CalendarCoverageUIProps) => {
95
+ const {
96
+ rows,
97
+ buckets,
98
+ resourceHeaderText,
99
+ emptyText,
100
+ countText,
101
+ resourceColumnWidth = 168,
102
+ bucketWidth = 56,
103
+ rowHeight = 34,
104
+ selectedViolationKey,
105
+ onSelectCell,
106
+ } = p;
107
+
108
+ if (!rows.length || !buckets.length) {
109
+ return (
110
+ <div className='f h_0 v_center a_c'>
111
+ <span className='ft_sm cl_lt'>{emptyText}</span>
112
+ </div>
113
+ );
114
+ }
115
+
116
+ // The board is wider than its container by design; the scroller needs a
117
+ // real width to scroll to, and both sticky edges hang off it
118
+ const boardWidth = resourceColumnWidth + (buckets.length * bucketWidth);
119
+
120
+ return (
121
+ <div className='f h_0 w_f app_scr of_x auto_x auto_y'>
122
+ <div className='v_stretch' style={{ width: boardWidth }}>
123
+ <div
124
+ className='no_shrink h_item sticky bg bd_b_1 bd_b_bd'
125
+ style={{ top: 0, zIndex: 30 }}
126
+ >
127
+ <div
128
+ className='no_shrink v_stretch sticky bg ellip bd_r_1 bd_r_bd'
129
+ style={{ left: 0, width: resourceColumnWidth, zIndex: 20, paddingLeft: 8 }}
130
+ >
131
+ <span className='ellip ft_tn cl_lt'>{resourceHeaderText}</span>
132
+ </div>
133
+
134
+ {buckets.map((bucket) => (
135
+ <div
136
+ key={bucket.key}
137
+ className={cn('no_shrink v_stretch a_c of', bucket.isMuted ? 'bg_alt' : '')}
138
+ style={{ width: bucketWidth, paddingTop: 3, paddingBottom: 3 }}
139
+ >
140
+ <span className={cn('ellip ft_tn', bucket.isMuted ? 'cl_lt' : 'cl_md')}>
141
+ {bucket.label}
142
+ </span>
143
+
144
+ {bucket.subLabel ? <span className='ellip ft_tn cl_lt'>{bucket.subLabel}</span> : null}
145
+ </div>
146
+ ))}
147
+ </div>
148
+
149
+ {rows.map((row) => (
150
+ <div key={row.resourceId} className='no_shrink h_item bd_b_1 bd_b_bd' style={{ height: rowHeight }}>
151
+ <div
152
+ className='no_shrink v_center h_f sticky bg of bd_r_1 bd_r_bd'
153
+ style={{ left: 0, width: resourceColumnWidth, zIndex: 20, paddingLeft: 8, paddingRight: 6 }}
154
+ >
155
+ <span className='w_f ellip ft_tn'>{row.name}</span>
156
+
157
+ {row.subName ? <span className='w_f ellip ft_tn cl_lt'>{row.subName}</span> : null}
158
+ </div>
159
+
160
+ {row.cells.map((cell) => {
161
+ // Short is short whatever the engine called it; the
162
+ // severity only decides how loudly it is said
163
+ const isShort = !cell.isEmpty && cell.actual < cell.required;
164
+ const isBlocking = isShort && cell.severity === 'BLOCK';
165
+ const isSelected = !!selectedViolationKey && cell.violationKey === selectedViolationKey;
166
+
167
+ return (
168
+ <button
169
+ key={cell.key}
170
+ type='button'
171
+ className={cn(
172
+ 'no_shrink h_center h_f rel bd_l_1 bd_l_bd',
173
+ isBlocking ? 'bg_red_alt_lt' : isShort ? 'bg_amber_alt_lt' : '',
174
+ // The stripe needs a relative parent and a colour
175
+ // for its overlay; `medium_bf` is the neutral one
176
+ cell.isDraft ? `${CALENDAR_DRAFT_PATTERN_CLASS_NAME} medium_bf` : '',
177
+ isSelected ? 'ol_primary' : '',
178
+ )}
179
+ style={{ width: bucketWidth }}
180
+ onClick={onSelectCell ? () => onSelectCell(row.resourceId, cell) : undefined}
181
+ >
182
+ {/* Positioned so it paints above the stripe overlay */}
183
+ <span
184
+ className={cn(
185
+ 'rel ellip ft_tn',
186
+ isBlocking ? 'cl_err ft_bold' : isShort ? 'cl_warn ft_bold' : 'cl_md',
187
+ )}
188
+ >
189
+ {cell.isEmpty ? '' : countText(cell.actual, cell.required)}
190
+ </span>
191
+ </button>
192
+ );
193
+ })}
194
+ </div>
195
+ ))}
196
+ </div>
197
+ </div>
198
+ );
199
+ });
@@ -0,0 +1,260 @@
1
+ import { cn } from '@jsb188/app/utils/string.ts';
2
+ import { AvatarImg } from '@jsb188/react-web/ui/Avatar';
3
+ import { Button, SimpleLabel } from '@jsb188/react-web/ui/Button';
4
+ import { Icon } from '@jsb188/react-web/svgs/Icon';
5
+ import { memo } from 'react';
6
+ import { CALENDAR_DRAFT_PATTERN_CLASS_NAME } from '../constants/calendar.ts';
7
+
8
+ /**
9
+ * The bubble that opens when one occurrence is selected.
10
+ *
11
+ * Everything arrives already formatted — no Date, no zone, no plural rules
12
+ * cross this boundary. The grid and this bubble must agree about what "9:00 AM
13
+ * – 5:00 PM" means, and the only way to guarantee that is for one place to do
14
+ * the formatting and both to render the same string.
15
+ *
16
+ * Actions are opt-in: a button appears only when its handler was passed. That
17
+ * is what lets the same bubble serve a manager (edit, cancel, delete) and a
18
+ * worker (give away this shift) without either of them being handed a control
19
+ * that would fail on the server.
20
+ */
21
+
22
+ export interface CalendarEventDetailUIProps {
23
+ className?: string;
24
+ title: string;
25
+ // e.g. "Wed, Jul 22 · 9:00 AM – 5:00 PM", or the all-day wording
26
+ timeRangeText: string;
27
+ // DRAFT | PUBLISHED | CANCELED — drives the strike-through and the stripes
28
+ status: string;
29
+ statusText: string;
30
+ // A ColorEnum name; SimpleLabel only honors this on its outline preset
31
+ statusColor?: string | null;
32
+ location?: string | null;
33
+ note?: string | null;
34
+ // Display names, already resolved from the assignee account ids
35
+ assigneeNames: string[];
36
+ // Rendered only when there are open slots left, e.g. "2 spots open"
37
+ openCountText?: string | null;
38
+ closeText: string;
39
+ editText: string;
40
+ cancelOccurrenceText: string;
41
+ deleteText: string;
42
+ releaseText: string;
43
+ // Surfaced under the actions when the last mutation failed
44
+ errorText?: string | null;
45
+ // Disables every action while a mutation is in flight
46
+ busy?: boolean;
47
+ onEdit?: () => void;
48
+ onCancelOccurrence?: () => void;
49
+ onDelete?: () => void;
50
+ // "Give away this shift" — opens a release request rather than unassigning
51
+ onRelease?: () => void;
52
+ onClose: () => void;
53
+ }
54
+
55
+ /**
56
+ * One labelled line inside the bubble: an icon in a fixed gutter, the value
57
+ * beside it. The caller decides whether a row exists at all, so an occurrence
58
+ * with no location leaves no empty line behind.
59
+ */
60
+
61
+ function CalendarEventDetailRow(p: { iconName: string; children: React.ReactNode }) {
62
+ const { iconName, children } = p;
63
+
64
+ return (
65
+ <div className='h_item gap_sm' style={{ paddingTop: 3, paddingBottom: 3 }}>
66
+ <span className='no_shrink cl_lt h_center' style={{ width: 18 }}>
67
+ <Icon name={iconName} />
68
+ </span>
69
+
70
+ <span className='f ft_sm cl_df'>{children}</span>
71
+ </div>
72
+ );
73
+ }
74
+
75
+ export const CalendarEventDetailUI = memo((p: CalendarEventDetailUIProps) => {
76
+ const {
77
+ className,
78
+ title,
79
+ timeRangeText,
80
+ status,
81
+ statusText,
82
+ statusColor,
83
+ location,
84
+ note,
85
+ assigneeNames,
86
+ openCountText,
87
+ closeText,
88
+ editText,
89
+ cancelOccurrenceText,
90
+ deleteText,
91
+ releaseText,
92
+ errorText,
93
+ busy,
94
+ onEdit,
95
+ onCancelOccurrence,
96
+ onDelete,
97
+ onRelease,
98
+ onClose,
99
+ } = p;
100
+
101
+ const hasActions = !!(onEdit || onCancelOccurrence || onDelete || onRelease);
102
+
103
+ return (
104
+ <div className={cn('bg bd_1 bd_bd r_df of', className)}>
105
+ <div
106
+ className='h_item gap_sm bd_b_1 bd_b_bd'
107
+ style={{ paddingLeft: 12, paddingRight: 8, paddingTop: 8, paddingBottom: 8 }}
108
+ >
109
+ <span
110
+ className={cn(
111
+ 'f ft_md ft_bold ellip',
112
+ status === 'CANCELED' ? 'strikethrough cl_lt' : '',
113
+ )}
114
+ >
115
+ {title}
116
+ </span>
117
+
118
+ <SimpleLabel
119
+ className='no_shrink'
120
+ preset='outline'
121
+ color={statusColor || 'medium'}
122
+ text={statusText}
123
+ />
124
+
125
+ {/* No IconButton exists in the kit, so this is the documented raw
126
+ pattern: a bare button wrapping an Icon */}
127
+ <button
128
+ type='button'
129
+ className='av_sm h_center no_shrink cl_lt'
130
+ aria-label={closeText}
131
+ title={closeText}
132
+ onClick={onClose}
133
+ >
134
+ <Icon name='x' />
135
+ </button>
136
+ </div>
137
+
138
+ <div style={{ paddingLeft: 12, paddingRight: 12, paddingTop: 8, paddingBottom: 8 }}>
139
+ <CalendarEventDetailRow iconName='clock-hour-4'>
140
+ <span className={cn(status === 'DRAFT' ? CALENDAR_DRAFT_PATTERN_CLASS_NAME : '')}>
141
+ {timeRangeText}
142
+ </span>
143
+ </CalendarEventDetailRow>
144
+
145
+ {location
146
+ ? (
147
+ <CalendarEventDetailRow iconName='pin-location-1'>
148
+ {location}
149
+ </CalendarEventDetailRow>
150
+ )
151
+ : null}
152
+
153
+ {assigneeNames.length
154
+ ? (
155
+ <CalendarEventDetailRow iconName='multiple-neutral-circle'>
156
+ {/* Wrapping is structural here: the chip count is data, so the
157
+ row has to be able to run onto a second line */}
158
+ <span className='h_item gap_sm' style={{ flexWrap: 'wrap' }}>
159
+ {assigneeNames.map((name) => (
160
+ <span key={name} className='h_item gap_xs no_shrink'>
161
+ <AvatarImg size='tiny' displayName={name} />
162
+ <span className='ellip'>{name}</span>
163
+ </span>
164
+ ))}
165
+ </span>
166
+ </CalendarEventDetailRow>
167
+ )
168
+ : null}
169
+
170
+ {openCountText
171
+ ? (
172
+ <CalendarEventDetailRow iconName='single-neutral-actions-add'>
173
+ <span className='cl_md'>{openCountText}</span>
174
+ </CalendarEventDetailRow>
175
+ )
176
+ : null}
177
+
178
+ {note
179
+ ? (
180
+ <CalendarEventDetailRow iconName='notes-paper-text'>
181
+ <span className='cl_md'>{note}</span>
182
+ </CalendarEventDetailRow>
183
+ )
184
+ : null}
185
+ </div>
186
+
187
+ {errorText
188
+ ? (
189
+ <div
190
+ className='ft_xs cl_err'
191
+ style={{ paddingLeft: 12, paddingRight: 12, paddingBottom: 8 }}
192
+ >
193
+ {errorText}
194
+ </div>
195
+ )
196
+ : null}
197
+
198
+ {hasActions
199
+ ? (
200
+ <div
201
+ className='h_item gap_sm bd_t_1 bd_t_bd'
202
+ style={{ paddingLeft: 8, paddingRight: 8, paddingTop: 8, paddingBottom: 8, flexWrap: 'wrap' }}
203
+ >
204
+ {onEdit
205
+ ? (
206
+ <Button
207
+ preset='bg_secondary'
208
+ size='sm'
209
+ disabled={busy}
210
+ leftIconName='pencil-write-2'
211
+ text={editText}
212
+ onClick={onEdit}
213
+ />
214
+ )
215
+ : null}
216
+
217
+ {onRelease
218
+ ? (
219
+ <Button
220
+ preset='bg'
221
+ size='sm'
222
+ disabled={busy}
223
+ leftIconName='switch-account-1'
224
+ text={releaseText}
225
+ onClick={onRelease}
226
+ />
227
+ )
228
+ : null}
229
+
230
+ {onCancelOccurrence
231
+ ? (
232
+ <Button
233
+ preset='outline_subtle'
234
+ size='sm'
235
+ disabled={busy}
236
+ leftIconName='cancel'
237
+ text={cancelOccurrenceText}
238
+ onClick={onCancelOccurrence}
239
+ />
240
+ )
241
+ : null}
242
+
243
+ {onDelete
244
+ ? (
245
+ <Button
246
+ preset='cl_err'
247
+ size='sm'
248
+ disabled={busy}
249
+ leftIconName='bin'
250
+ text={deleteText}
251
+ onClick={onDelete}
252
+ />
253
+ )
254
+ : null}
255
+ </div>
256
+ )
257
+ : null}
258
+ </div>
259
+ );
260
+ });