Refactor point value object and add observability

This commit is contained in:
Bernard Ngandu
2025-10-10 14:55:36 +02:00
parent 8a43d3967c
commit 68eb54995f
46 changed files with 3691 additions and 229 deletions
+37
View File
@@ -0,0 +1,37 @@
import {
Toast,
ToastClose,
ToastDescription,
ToastProvider,
ToastTitle,
ToastViewport,
} from '@/components/ui/toast'
import { useToast } from '@/components/ui/use-toast'
export function Toaster() {
const { toasts, dismiss } = useToast()
return (
<ToastProvider>
{toasts.map(({ id, title, description, action, ...props }) => (
<Toast
key={id}
{...props}
onOpenChange={(open) => {
if (!open) {
dismiss(id)
}
}}
>
<div className="flex flex-1 flex-col gap-1">
{title ? <ToastTitle>{title}</ToastTitle> : null}
{description ? <ToastDescription>{description}</ToastDescription> : null}
</div>
{action}
<ToastClose />
</Toast>
))}
<ToastViewport />
</ToastProvider>
)
}