Files
zellyy-finance/src/components/ui/toaster.tsx
gpt-engineer-app[bot] 5bf8ff6e3f Fix toast text alignment
The text in the toast notification was left-aligned instead of centered. This commit fixes the alignment issue.
2025-03-18 01:56:46 +00:00

35 lines
788 B
TypeScript

import { useToast } from "@/hooks/toast"
import {
Toast,
ToastClose,
ToastDescription,
ToastProvider,
ToastTitle,
ToastViewport,
} from "@/components/ui/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 w-full text-center">
{title && <ToastTitle>{title}</ToastTitle>}
{description && (
<ToastDescription>{description}</ToastDescription>
)}
</div>
{action}
<ToastClose />
</Toast>
)
})}
<ToastViewport />
</ToastProvider>
)
}