18 lines
801 B
TypeScript
18 lines
801 B
TypeScript
'use client';
|
|
|
|
import * as ToastPrimitive from '@radix-ui/react-toast';
|
|
import { cn } from '@/lib/utils';
|
|
|
|
export const ToastProvider = ToastPrimitive.Provider;
|
|
export const ToastViewport = (props: React.ComponentProps<typeof ToastPrimitive.Viewport>) => (
|
|
<ToastPrimitive.Viewport className="fixed bottom-4 right-4 z-50 flex max-w-sm flex-col gap-2" {...props} />
|
|
);
|
|
|
|
export function Toast({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Root>) {
|
|
return <ToastPrimitive.Root className={cn('rounded-2xl bg-[#20212b] p-4 text-sm text-white shadow-xl', className)} {...props} />;
|
|
}
|
|
|
|
export function ToastTitle({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Title>) {
|
|
return <ToastPrimitive.Title className={cn('font-semibold', className)} {...props} />;
|
|
}
|