1 | import React from 'react';
|
2 | import CalendarButton from './CalendarButton';
|
3 | import { caretDown, chevronLeft, chevronRight } from './Icon';
|
4 |
|
5 | function 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 React.createElement("div", {
|
21 | className: "rw-calendar-header"
|
22 | }, 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), React.createElement(CalendarButton, {
|
30 | className: "rw-calendar-btn-left",
|
31 | onClick: onMoveLeft,
|
32 | disabled: prevDisabled,
|
33 | label: localizer.messages.moveBack(),
|
34 | icon: navigatePrevIcon
|
35 | }), React.createElement(CalendarButton, {
|
36 | className: "rw-calendar-btn-today",
|
37 | disabled: todayDisabled,
|
38 | onClick: onMoveToday
|
39 | }, localizer.messages.moveToday()), 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 |
|
48 | export default CalendarHeader; |
\ | No newline at end of file |