mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-19 11:12:00 +10:00
refactor(v4.0.0-alpha): beginning of a new era
This commit is contained in:
37
apps/client/src/providers/toaster.tsx
Normal file
37
apps/client/src/providers/toaster.tsx
Normal file
@ -0,0 +1,37 @@
|
||||
import {
|
||||
Toast,
|
||||
ToastClose,
|
||||
ToastDescription,
|
||||
ToastProvider,
|
||||
ToastTitle,
|
||||
ToastViewport,
|
||||
} from "@reactive-resume/ui";
|
||||
|
||||
import { useToast } from "../hooks/use-toast";
|
||||
|
||||
export const Toaster = () => {
|
||||
const { toasts } = useToast();
|
||||
|
||||
return (
|
||||
<ToastProvider>
|
||||
{toasts.map(({ id, icon, title, description, action, ...props }) => {
|
||||
return (
|
||||
<Toast key={id} {...props}>
|
||||
<div className="grid gap-1">
|
||||
<div className="flex items-center gap-x-2">
|
||||
{icon}
|
||||
{title && <ToastTitle>{title}</ToastTitle>}
|
||||
</div>
|
||||
{description && <ToastDescription>{description}</ToastDescription>}
|
||||
</div>
|
||||
|
||||
{action}
|
||||
<ToastClose />
|
||||
</Toast>
|
||||
);
|
||||
})}
|
||||
|
||||
<ToastViewport />
|
||||
</ToastProvider>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user