@awsui/components-react
Version:
AWS UI is a collection of [React](https://reactjs.org/) components that help create intuitive, responsive, and accessible user experiences for web applications. It is developed by Amazon Web Services (AWS). This work is available under the terms of the [A
19 lines (18 loc) • 869 B
JavaScript
import { __assign } from "tslib";
import React from 'react';
import { InternalButton } from '../../../../button/internal';
import styles from '../../../styles.css.js';
var HeaderButton = function (_a) {
var ariaLabel = _a.ariaLabel, isPrevious = _a.isPrevious, onChangeMonth = _a.onChangeMonth, focusable = _a.focusable;
var iconName = isPrevious ? 'angle-left' : 'angle-right';
var additionalAttributes = {
className: isPrevious ? styles['calendar-prev-month-btn'] : styles['calendar-next-month-btn'],
tabIndex: focusable ? 0 : -1
};
var onClick = function (e) {
e.preventDefault();
onChangeMonth(isPrevious);
};
return (React.createElement(InternalButton, __assign({}, additionalAttributes, { iconName: iconName, ariaLabel: ariaLabel, variant: 'icon', onClick: onClick })));
};
export default HeaderButton;