inputs-2-react
Version:
Inputs extracted from adminlte-2-react
27 lines (21 loc) • 611 B
JSX
import React from 'react';
import PropTypes from 'prop-types';
import { Types } from '../PropTypes';
const Label = ({
id, type, pullRight, children,
}) => (<span id={id} className={`label label-${type}${pullRight ? ' pull-right' : ''}`}>{children}</span>);
Label.propTypes = {
id: PropTypes.string,
type: PropTypes.oneOf(Types).isRequired,
pullRight: PropTypes.bool,
children: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.node),
PropTypes.node,
]),
};
Label.defaultProps = {
id: undefined,
children: null,
pullRight: false,
};
export default Label;