@salesforce/design-system-react
Version:
Salesforce Lightning Design System for React
42 lines (36 loc) • 1.38 kB
JavaScript
/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */
/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
// ### React
// React is an external dependency of the project.
import React from 'react';
import PropTypes from 'prop-types';
import { CARD_EMPTY } from '../../utilities/constants';
/**
* A default empty state for Cards.
*/
var CardEmpty = function CardEmpty(_ref) {
var _ref$heading = _ref.heading,
heading = _ref$heading === void 0 ? 'No Related Items' : _ref$heading,
children = _ref.children;
return /*#__PURE__*/React.createElement("div", {
className: "slds-p-horizontal_small"
}, /*#__PURE__*/React.createElement("div", {
className: "slds-text-align_center slds-m-bottom_x-large"
}, /*#__PURE__*/React.createElement("h3", {
className: "slds-text-heading_small slds-p-top_large slds-p-bottom_large"
}, heading), children));
}; // ### Display Name
// Always use the canonical component name as the React display name.
CardEmpty.displayName = CARD_EMPTY; // ### Prop Types
CardEmpty.propTypes = {
/**
* Additional call to actions that will render under the heading. Often this is an "Add Item" button.
*/
children: PropTypes.node,
/**
* Primary text for an Empty Card.
*/
heading: PropTypes.string
};
export default CardEmpty;
//# sourceMappingURL=empty.js.map