UNPKG

mantine-entity

Version:

A library combining Mantine, TanStack Query, and Mantine React Table for efficient entity management

38 lines (37 loc) 1.27 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { notifications } from "@mantine/notifications"; import { IconAlertTriangle, IconCheck, IconExclamationCircle, } from "@tabler/icons-react"; const notify = ({ type = "success", message = "", }) => { switch (type) { case "error": return notifications.show({ withCloseButton: true, autoClose: 5000, color: "red", title: "", message: message, icon: _jsx(IconExclamationCircle, { size: "1rem" }), }); case "warning": return notifications.show({ withCloseButton: true, autoClose: 5000, color: "yellow", title: "", message: message, icon: _jsx(IconAlertTriangle, { size: "1rem" }), }); case "success": return notifications.show({ withCloseButton: true, autoClose: 5000, color: "teal", title: "", message: message, icon: _jsx(IconCheck, { size: "1rem" }), }); default: return; } }; export default notify;