import Button from "@material-ui/core/Button"; import IconButton from "@material-ui/core/IconButton"; import SnackbarContent from "@material-ui/core/SnackbarContent"; import Typography from "@material-ui/core/Typography"; import CloseIcon from "@material-ui/icons/Close"; import classNames from "classnames"; import React, { useState } from "react"; import { AlertComponentPropsWithStyle } from "react-alert"; import { FormattedMessage } from "react-intl"; import { IMessage } from "./"; import { useStyles } from "./styles"; export interface IMessageManagerProps extends AlertComponentPropsWithStyle { message: IMessage; } export const MessageManager: React.FC = props => { const { close, options: { timeout }, message: { actionBtn, expandText, status, title, text, onUndo } } = props; const [expand, setExpand] = useState(false); const classes = useStyles({}); return (
{title && ( {title} )} {text} } action={[ !!expandText ? (

{expandText}

) : ( undefined ),
{!!onUndo && ( )} {!!actionBtn && ( )}
, ,
]} />
); }; export default MessageManager;