diff options
| author | Sebastien Castiel <sebastien@castiel.me> | 2024-01-09 15:32:19 -0500 |
|---|---|---|
| committer | Sebastien Castiel <sebastien@castiel.me> | 2024-01-09 15:32:19 -0500 |
| commit | 323b0ea1282abc0945cef1ebf8185bdf9a156f5d (patch) | |
| tree | 5526370fed1acbcb3cc2d43b9b1d0a6264783b47 /src/components/ui/toaster.tsx | |
| parent | 5ce96aef30b87a1aeecfac67e99621b06ab64b93 (diff) | |
Feedback button
Diffstat (limited to 'src/components/ui/toaster.tsx')
| -rw-r--r-- | src/components/ui/toaster.tsx | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/components/ui/toaster.tsx b/src/components/ui/toaster.tsx new file mode 100644 index 0000000..e223385 --- /dev/null +++ b/src/components/ui/toaster.tsx @@ -0,0 +1,35 @@ +"use client" + +import { + Toast, + ToastClose, + ToastDescription, + ToastProvider, + ToastTitle, + ToastViewport, +} from "@/components/ui/toast" +import { useToast } from "@/components/ui/use-toast" + +export function Toaster() { + const { toasts } = useToast() + + return ( + <ToastProvider> + {toasts.map(function ({ id, title, description, action, ...props }) { + return ( + <Toast key={id} {...props}> + <div className="grid gap-1"> + {title && <ToastTitle>{title}</ToastTitle>} + {description && ( + <ToastDescription>{description}</ToastDescription> + )} + </div> + {action} + <ToastClose /> + </Toast> + ) + })} + <ToastViewport /> + </ToastProvider> + ) +} |
