mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-25 09:55:15 +00:00
47 lines
1.6 KiB
JavaScript
47 lines
1.6 KiB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import classNames from 'classnames';
|
|
import { mapToCssModules, tagPropType } from './utils';
|
|
var propTypes = {
|
|
children: PropTypes.node,
|
|
className: PropTypes.string,
|
|
listClassName: PropTypes.string,
|
|
cssModule: PropTypes.object,
|
|
size: PropTypes.string,
|
|
tag: tagPropType,
|
|
listTag: tagPropType,
|
|
'aria-label': PropTypes.string
|
|
};
|
|
var defaultProps = {
|
|
tag: 'nav',
|
|
listTag: 'ul',
|
|
'aria-label': 'pagination'
|
|
};
|
|
|
|
var Pagination = function Pagination(props) {
|
|
var _classNames;
|
|
|
|
var className = props.className,
|
|
listClassName = props.listClassName,
|
|
cssModule = props.cssModule,
|
|
size = props.size,
|
|
Tag = props.tag,
|
|
ListTag = props.listTag,
|
|
label = props['aria-label'],
|
|
attributes = _objectWithoutPropertiesLoose(props, ["className", "listClassName", "cssModule", "size", "tag", "listTag", "aria-label"]);
|
|
|
|
var classes = mapToCssModules(classNames(className), cssModule);
|
|
var listClasses = mapToCssModules(classNames(listClassName, 'pagination', (_classNames = {}, _classNames["pagination-" + size] = !!size, _classNames)), cssModule);
|
|
return /*#__PURE__*/React.createElement(Tag, {
|
|
className: classes,
|
|
"aria-label": label
|
|
}, /*#__PURE__*/React.createElement(ListTag, _extends({}, attributes, {
|
|
className: listClasses
|
|
})));
|
|
};
|
|
|
|
Pagination.propTypes = propTypes;
|
|
Pagination.defaultProps = defaultProps;
|
|
export default Pagination; |