芝麻web文件管理V1.00
编辑当前文件:/home/freeclou/app.optimyar.com/backend/node_modules/@buffetjs/core/src/components/Label/index.js
/** * * Label * */ import React from 'react'; import PropTypes from 'prop-types'; import { isFunction } from 'lodash'; import { Label as StyledLabel } from '@buffetjs/styles'; function Label(props) { const content = (() => { if (isFunction(props.message)) { return props.message(); } if (props.message) { return props.message; } return props.children; })(); return (
{content}
); } Label.defaultProps = { children: null, className: null, message: null, }; Label.propTypes = { children: PropTypes.node, className: PropTypes.string, htmlFor: PropTypes.string.isRequired, message: PropTypes.oneOfType([ PropTypes.func, PropTypes.string, PropTypes.shape({ id: PropTypes.string, params: PropTypes.object, }), ]), }; export default Label;