This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
Files
scoresaber-reloadedv3/src/components/ui/toaster.tsx

36 lines
792 B
TypeScript
Raw Normal View History

2024-09-11 23:10:16 +01:00
"use client";
2024-09-08 22:35:32 +01:00
2024-09-11 23:10:16 +01:00
import { useToast } from "@/hooks/use-toast";
2024-09-13 13:45:04 +01:00
import {
Toast,
ToastClose,
ToastDescription,
ToastProvider,
ToastTitle,
ToastViewport,
} from "@/components/ui/toast";
2024-09-08 22:35:32 +01:00
export function Toaster() {
2024-09-11 23:10:16 +01:00
const { toasts } = useToast();
2024-09-08 22:35:32 +01:00
return (
<ToastProvider>
{toasts.map(function ({ id, title, description, action, ...props }) {
return (
<Toast key={id} {...props}>
<div className="grid gap-1">
{title && <ToastTitle>{title}</ToastTitle>}
2024-09-13 13:45:04 +01:00
{description && (
<ToastDescription>{description}</ToastDescription>
)}
2024-09-08 22:35:32 +01:00
</div>
{action}
<ToastClose />
</Toast>
2024-09-11 23:10:16 +01:00
);
2024-09-08 22:35:32 +01:00
})}
<ToastViewport />
</ToastProvider>
2024-09-11 23:10:16 +01:00
);
2024-09-08 22:35:32 +01:00
}