mirror of
https://github.com/tale/headplane.git
synced 2026-09-04 11:15:42 +00:00
feat: replace button and toast provider with base-ui
This commit is contained in:
+4
-11
@@ -1,14 +1,7 @@
|
||||
import { ToastQueue } from '@react-stately/toast';
|
||||
import React from 'react';
|
||||
import { Toast } from "@base-ui/react/toast";
|
||||
|
||||
const toastQueue = new ToastQueue<React.ReactNode>({
|
||||
maxVisibleToasts: 7,
|
||||
});
|
||||
export const toastManager = Toast.createToastManager();
|
||||
|
||||
export function useToastQueue() {
|
||||
return toastQueue;
|
||||
}
|
||||
|
||||
export default function toast(content: React.ReactNode, duration = 3000) {
|
||||
return toastQueue.add(content, { timeout: duration });
|
||||
export default function toast(content: string, duration = 3000) {
|
||||
return toastManager.add({ description: content, timeout: duration });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user