UNPKG

@nexusui/components

Version:

These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.

2 lines (1 loc) 816 B
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{forwardRef as r}from"react";import{SnackbarContent as i,closeSnackbar as a}from"notistack";import o from"@mui/material/Alert";import l from"@mui/material/AlertTitle";const s="NexusSnackbarAlert",n=r(((r,n)=>{const{id:c,message:m,variant:d="info",title:p,description:f,icon:$,action:u,enableClose:v,alertProps:x,alertTitleProps:y,sx:A}=r;return t(i,{ref:n,role:"alert",className:`${s}-root`,children:e(o,{sx:[{width:"100%"},...Array.isArray(A)?A:[A]],elevation:6,variant:"filled",icon:$,severity:d,action:u,onClose:v?(t,e)=>{"clickaway"!==e&&a(c)}:void 0,className:`${s}-${d}`,"data-testid":`${s}-${d}`,...x,children:[p&&("string"==typeof p?t(l,{className:`${s}-title`,"data-testid":`${s}-title`,...y,children:p}):p),f||m]})},c)}));export{n as SnackbarAlert};