({ ...props }: ToasterProps)
| 12 | import { Toaster as Sonner, type ToasterProps } from "sonner"; |
| 13 | |
| 14 | const Toaster = ({ ...props }: ToasterProps) => { |
| 15 | const { theme = "system" } = useTheme(); |
| 16 | |
| 17 | return ( |
| 18 | <Sonner |
| 19 | theme={theme as ToasterProps["theme"]} |
| 20 | className="toaster group" |
| 21 | icons={{ |
| 22 | success: ( |
| 23 | <HugeiconsIcon |
| 24 | icon={CheckmarkCircle02Icon} |
| 25 | strokeWidth={2} |
| 26 | className="size-4" |
| 27 | /> |
| 28 | ), |
| 29 | info: ( |
| 30 | <HugeiconsIcon |
| 31 | icon={InformationCircleIcon} |
| 32 | strokeWidth={2} |
| 33 | className="size-4" |
| 34 | /> |
| 35 | ), |
| 36 | warning: ( |
| 37 | <HugeiconsIcon |
| 38 | icon={Alert02Icon} |
| 39 | strokeWidth={2} |
| 40 | className="size-4" |
| 41 | /> |
| 42 | ), |
| 43 | error: ( |
| 44 | <HugeiconsIcon |
| 45 | icon={MultiplicationSignCircleIcon} |
| 46 | strokeWidth={2} |
| 47 | className="size-4" |
| 48 | /> |
| 49 | ), |
| 50 | loading: ( |
| 51 | <HugeiconsIcon |
| 52 | icon={Loading03Icon} |
| 53 | strokeWidth={2} |
| 54 | className="size-4 animate-spin" |
| 55 | /> |
| 56 | ), |
| 57 | }} |
| 58 | style={ |
| 59 | { |
| 60 | "--normal-bg": "var(--popover)", |
| 61 | "--normal-text": "var(--popover-foreground)", |
| 62 | "--normal-border": "var(--border)", |
| 63 | "--border-radius": "var(--radius)", |
| 64 | } as React.CSSProperties |
| 65 | } |
| 66 | toastOptions={{ |
| 67 | classNames: { |
| 68 | toast: "cn-toast", |
| 69 | }, |
| 70 | }} |
| 71 | {...props} |
nothing calls this directly
no outgoing calls
no test coverage detected