UNPKG

1.39 kBJavaScriptView Raw
1import React from 'react';
2import CalendarButton from './CalendarButton';
3import { caretDown, chevronLeft, chevronRight } from './Icon';
4
5function CalendarHeader({
6 localizer,
7 label,
8 labelId,
9 onMoveRight,
10 onMoveToday,
11 onMoveLeft,
12 onViewChange,
13 prevDisabled,
14 todayDisabled,
15 upDisabled,
16 nextDisabled,
17 navigatePrevIcon = chevronLeft,
18 navigateNextIcon = chevronRight
19}) {
20 return /*#__PURE__*/React.createElement("div", {
21 className: "rw-calendar-header"
22 }, /*#__PURE__*/React.createElement(CalendarButton, {
23 id: labelId,
24 onClick: onViewChange,
25 className: "rw-calendar-btn-view",
26 disabled: upDisabled,
27 "aria-live": "polite",
28 "aria-atomic": "true"
29 }, label, " ", caretDown), /*#__PURE__*/React.createElement(CalendarButton, {
30 className: "rw-calendar-btn-left",
31 onClick: onMoveLeft,
32 disabled: prevDisabled,
33 label: localizer.messages.moveBack(),
34 icon: navigatePrevIcon
35 }), /*#__PURE__*/React.createElement(CalendarButton, {
36 className: "rw-calendar-btn-today",
37 disabled: todayDisabled,
38 onClick: onMoveToday
39 }, localizer.messages.moveToday()), /*#__PURE__*/React.createElement(CalendarButton, {
40 className: "rw-calendar-btn-right",
41 onClick: onMoveRight,
42 disabled: nextDisabled,
43 label: localizer.messages.moveForward(),
44 icon: navigateNextIcon
45 }));
46}
47
48export default CalendarHeader;
\No newline at end of file