summaryrefslogtreecommitdiff
path: root/components/ui/toasterSonner.tsx
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-03-26 00:37:41 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-03-26 00:37:41 +0000
commite0dfb55c5457aec489fc084c4567e791b4c65eb1 (patch)
tree68543a65d88f5afb3a0202925804103daa91bc6f /components/ui/toasterSonner.tsx
3/25 까지의 대표님 작업사항
Diffstat (limited to 'components/ui/toasterSonner.tsx')
-rw-r--r--components/ui/toasterSonner.tsx32
1 files changed, 32 insertions, 0 deletions
diff --git a/components/ui/toasterSonner.tsx b/components/ui/toasterSonner.tsx
new file mode 100644
index 00000000..6028f0cd
--- /dev/null
+++ b/components/ui/toasterSonner.tsx
@@ -0,0 +1,32 @@
+"use client"
+
+import { useTheme } from "next-themes"
+import { Toaster as Sonner } from "sonner"
+
+type ToasterProps = React.ComponentProps<typeof Sonner>
+
+function ToasterSonner({ ...props }: ToasterProps) {
+ const { theme = "system" } = useTheme()
+
+ return (
+ <Sonner
+ theme={theme as ToasterProps["theme"]}
+ // eslint-disable-next-line tailwindcss/no-custom-classname
+ className="toaster group"
+ toastOptions={{
+ classNames: {
+ toast:
+ "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
+ description: "group-[.toast]:text-muted-foreground",
+ actionButton:
+ "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
+ cancelButton:
+ "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
+ },
+ }}
+ {...props}
+ />
+ )
+}
+
+export { ToasterSonner }