UNPKG

910 BJavaScriptView Raw
1import React from 'react';
2import PropTypes from 'prop-types';
3import classNames from 'classnames';
4import { mapToCssModules, tagPropType } from './utils';
5import Button from './Button';
6import { getColumnClasses } from './Col';
7
8const propTypes = {
9 size: PropTypes.string,
10 color: PropTypes.string,
11 outline: PropTypes.bool,
12 className: PropTypes.string,
13 tag: tagPropType,
14 cssModule: PropTypes.object,
15};
16
17function PlaceholderButton(props) {
18 let { cssModule, className, tag: Tag = Button, ...attributes } = props;
19
20 let { modifiedAttributes, colClasses } = getColumnClasses(
21 { color: 'primary', ...attributes },
22 cssModule,
23 );
24
25 const classes = mapToCssModules(
26 classNames('placeholder', className, colClasses),
27 cssModule,
28 );
29
30 return <Tag {...modifiedAttributes} className={classes} disabled />;
31}
32
33PlaceholderButton.propTypes = propTypes;
34
35export default PlaceholderButton;
36
\No newline at end of file