Download frontend/src/components/ui/sonner.tsx from new-arc/vector: direct link, hf CLI and curl.
- Browser
- Download file 662 Bytes
-
https://huggingface.co/spaces/new-arc/vector/resolve/main/frontend/src/components/ui/sonner.tsx
- Command line
-
hf download hf://spaces/new-arc/vector/frontend/src/components/ui/sonner.tsx
-
curl -L -o sonner.tsx https://huggingface.co/spaces/new-arc/vector/resolve/main/frontend/src/components/ui/sonner.tsx
662 Bytes
| "use client" | |
| import { useTheme } from "next-themes" | |
| import { Toaster as Sonner, ToasterProps } from "sonner" | |
| const Toaster = ({ ...props }: ToasterProps) => { | |
| // Marketing pages force light while the saved theme may be dark. | |
| const { forcedTheme, theme } = useTheme() | |
| return ( | |
| <Sonner | |
| theme={(forcedTheme ?? theme ?? "light") as ToasterProps["theme"]} | |
| className="toaster group" | |
| style={ | |
| { | |
| "--normal-bg": "var(--popover)", | |
| "--normal-text": "var(--popover-foreground)", | |
| "--normal-border": "var(--border)", | |
| } as React.CSSProperties | |
| } | |
| {...props} | |
| /> | |
| ) | |
| } | |
| export { Toaster } | |