@momentum-ui/react-collaboration
Version:
Cisco Momentum UI Framework for React Collaboration Applications
29 lines • 1.61 kB
JavaScript
import React, { cloneElement } from 'react';
import classnames from 'classnames';
import { STYLE } from './ToastContent.constants';
import './ToastContent.style.scss';
/**
* The `<ToastContent />` component. This component is meant to be consumed by only the `<Toast />` component.
* @deprecated Use the equivalent from momentum.design (NPM: `@momentum-design/components/dist/react`)
*/
var ToastContent = function (props) {
var action = props.action, actionColor = props.actionColor, actions = props.actions, actor = props.actor, children = props.children, className = props.className, id = props.id, info = props.info, style = props.style;
var actorComponent = actor ? React.createElement("span", { className: STYLE.actor }, actor) : null;
var actionComponent = action ? (React.createElement("span", { className: STYLE.action, "data-color": actionColor }, action)) : null;
var scopeComponent = action || actor ? (React.createElement("div", { className: STYLE.scope },
actorComponent,
" ",
actionComponent)) : null;
var infoComponent = info || children ? React.createElement("div", { className: STYLE.info }, info || children) : null;
var actionsComponent = actions
? cloneElement(actions, {
className: classnames(STYLE.actions, actions.props.className),
})
: null;
return (React.createElement("div", { className: classnames(className, STYLE.wrapper), id: id, style: style },
scopeComponent,
infoComponent,
actionsComponent));
};
export default ToastContent;
//# sourceMappingURL=ToastContent.js.map