feat: switch to new toast provider

This commit is contained in:
Aarnav Tale 2025-01-28 16:06:41 -05:00
parent a19eb6bcda
commit 2c8880c84d
No known key found for this signature in database
8 changed files with 151 additions and 49 deletions

14
app/utils/toast.ts Normal file
View file

@ -0,0 +1,14 @@
import { ToastQueue } from '@react-stately/toast';
import React from 'react';
const toastQueue = new ToastQueue<React.ReactNode>({
maxVisibleToasts: 7,
});
export function useToastQueue() {
return toastQueue;
}
export default function toast(content: React.ReactNode, duration = 3000) {
return toastQueue.add(content, { timeout: duration });
}