diff options
| author | Maze Winther <mazewinther@gmail.com> | 2025-06-22 10:02:50 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2025-06-22 10:02:50 +0200 |
| commit | 87a83a5604b20550430ef4eefbcd573d309694e2 (patch) | |
| tree | 7ed86f00b8414cb6543f5c5ac98ea6e9abd2e10f /apps/web/src/components/ui/toaster.tsx | |
| download | opencut-87a83a5604b20550430ef4eefbcd573d309694e2.tar.gz | |
Initial commit
Diffstat (limited to 'apps/web/src/components/ui/toaster.tsx')
| -rw-r--r-- | apps/web/src/components/ui/toaster.tsx | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/apps/web/src/components/ui/toaster.tsx b/apps/web/src/components/ui/toaster.tsx new file mode 100644 index 00000000..3eb8a720 --- /dev/null +++ b/apps/web/src/components/ui/toaster.tsx @@ -0,0 +1,35 @@ +"use client"; + +import { useToast } from "../../hooks/use-toast"; +import { + Toast, + ToastClose, + ToastDescription, + ToastProvider, + ToastTitle, + ToastViewport, +} from "./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> + ); +} |
