Repository URL to install this package:
|
Version:
2.8.0-studio-release ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const exotic_1 = require("exotic");
const Empty_1 = require("../../../../atoms/Empty");
const styled_1 = require("./styled"); // rendering heading
function defaultRenderHeading(props) {
const {
heading,
pendingCount,
headingDataQa
} = props;
const zeroCount = pendingCount === 0 || pendingCount === '0';
const headingContent = `${heading} ${zeroCount || pendingCount ? '-' : ''}`;
const countView = zeroCount || pendingCount ? react_1.default.createElement(styled_1.PendingCount, {
zeroPendingCount: zeroCount
}, ` ${pendingCount}`) : react_1.default.createElement(Empty_1.Empty, null);
return react_1.default.createElement(react_1.default.Fragment, null, react_1.default.createElement(styled_1.StyledHeading, {
breedType: "h3",
content: headingContent,
"data-qa": headingDataQa
}), countView);
}
exports.defaultRenderHeading = defaultRenderHeading; // rendering the description
function defaultRenderDescription(props) {
return react_1.default.createElement(styled_1.StyledDescription, {
content: props.description
});
}
exports.defaultRenderDescription = defaultRenderDescription; // rendering the button
function defaultRenderButton(props) {
const {
onButtonClick,
buttonContent,
buttonDataQa
} = props;
const handleButtonClick = event => {
if (exotic_1.isFunction(onButtonClick)) {
const changeArgs = {
event
};
onButtonClick(changeArgs);
}
};
return react_1.default.createElement(styled_1.StyledGhostButton, {
"data-qa": buttonDataQa,
text: buttonContent,
onClick: handleButtonClick
});
}
exports.defaultRenderButton = defaultRenderButton; //# sourceMappingURL=renderProps.js.map