UNPKG

1.34 kBJavaScriptView Raw
1import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
2import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
3import PropTypes from 'prop-types';
4import React from 'react';
5import cn from 'classnames';
6import { prefix, bsClass, splitBsProps } from './utils/bootstrapUtils';
7var contextTypes = {
8 $bs_panel: PropTypes.shape({
9 bsClass: PropTypes.string
10 })
11};
12
13var PanelFooter =
14/*#__PURE__*/
15function (_React$Component) {
16 _inheritsLoose(PanelFooter, _React$Component);
17
18 function PanelFooter() {
19 return _React$Component.apply(this, arguments) || this;
20 }
21
22 var _proto = PanelFooter.prototype;
23
24 _proto.render = function render() {
25 var _this$props = this.props,
26 children = _this$props.children,
27 className = _this$props.className;
28
29 var _ref = this.context.$bs_panel || {},
30 _bsClass = _ref.bsClass;
31
32 var _splitBsProps = splitBsProps(this.props),
33 bsProps = _splitBsProps[0],
34 elementProps = _splitBsProps[1];
35
36 bsProps.bsClass = _bsClass || bsProps.bsClass;
37 return React.createElement("div", _extends({}, elementProps, {
38 className: cn(className, prefix(bsProps, 'footer'))
39 }), children);
40 };
41
42 return PanelFooter;
43}(React.Component);
44
45PanelFooter.contextTypes = contextTypes;
46export default bsClass('panel', PanelFooter);
\No newline at end of file