forked from digiaonline/react-foundation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlabel.js
More file actions
28 lines (24 loc) · 750 Bytes
/
label.js
File metadata and controls
28 lines (24 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import React, { PropTypes } from 'react';
import { LabelColors } from '../enums';
import { GeneralPropTypes, createClassName, generalClassNames, removeProps, objectKeys, objectValues } from '../utils';
/**
* Label component.
* http://foundation.zurb.com/sites/docs/label.html
*
* @param {Object} props
* @returns {Object}
*/
export const Label = (props) => {
const className = createClassName(
props.noDefaultClassName ? null : 'label',
props.className,
props.color,
generalClassNames(props)
);
const passProps = removeProps(props, objectKeys(Label.propTypes));
return <span {...passProps} className={className}/>;
};
Label.propTypes = {
...GeneralPropTypes,
color: PropTypes.oneOf(objectValues(LabelColors))
};