mirror of
https://github.com/tale/headplane.git
synced 2026-08-08 05:13:15 +00:00
feat: switch to new toast provider
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
Reference in New Issue
Block a user