UNPKG

@selfcommunity/react-ui

Version:

React UI Components to integrate a Community created with SelfCommunity Platform.

29 lines (28 loc) 1.28 kB
import { __rest } from "tslib"; import { jsx as _jsx } from "react/jsx-runtime"; import { styled } from '@mui/material/styles'; import { useThemeProps } from '@mui/system'; import { Snackbar, Alert } from '@mui/material'; import classNames from 'classnames'; import { FormattedMessage } from 'react-intl'; const PREFIX = 'SCUserDeletedSnackBar'; const classes = { root: `${PREFIX}-root` }; const Root = styled(Snackbar, { name: PREFIX, slot: 'Root', overridesResolver: (props, styles) => styles.root })(({ theme }) => ({})); export default function UserDeletedSnackBar(inProps) { // PROPS const props = useThemeProps({ props: inProps, name: PREFIX }); const { className, open = false, handleClose } = props, rest = __rest(props, ["className", "open", "handleClose"]); return (_jsx(Root, Object.assign({ className: classNames(className, classes.root), open: open, autoHideDuration: 3000, onClose: handleClose, anchorOrigin: { vertical: 'top', horizontal: 'center' } }, rest, { children: _jsx(Alert, Object.assign({ severity: "info", onClose: handleClose }, { children: _jsx(FormattedMessage, { id: "ui.common.actionToUserDeleted", defaultMessage: "ui.common.actionToUserDeleted" }) })) }))); }