Vercel/src/toast/ToasterWithThemes.tsx
2025-02-18 21:58:32 -06:00

26 lines
594 B
TypeScript

'use client';
import { clsx } from 'clsx/lite';
import { useTheme } from 'next-themes';
import { Toaster } from 'sonner';
export default function ToasterWithThemes() {
const { theme } = useTheme();
return (
<Toaster
theme={theme as 'system' | 'light' | 'dark'}
toastOptions={{
classNames: {
toast: clsx(
'flex items-center gap-x-1.5 p-4 w-full',
'font-mono text-sm',
'bg-white dark:bg-black',
'text-gray-900 dark:text-gray-100',
'border-medium!',
),
},
}}
/>
);
}