({ children }: { children: React.ReactNode })
| 148 | // ── Provider (mount once in layout) ────────────────────────────────────────── |
| 149 | |
| 150 | export function ToastProvider({ children }: { children: React.ReactNode }) { |
| 151 | const toasts = useToastStore() |
| 152 | |
| 153 | return ( |
| 154 | <RadixToast.Provider swipeDirection="right"> |
| 155 | {children} |
| 156 | {toasts.map((t) => ( |
| 157 | <ToastItem key={t.id} {...t} /> |
| 158 | ))} |
| 159 | <RadixToast.Viewport className="fixed bottom-4 right-4 z-[100] flex flex-col gap-2 w-80 focus:outline-none" /> |
| 160 | </RadixToast.Provider> |
| 161 | ) |
| 162 | } |
| 163 | |
| 164 | // ── Hook (alternative to imperative API) ───────────────────────────────────── |
| 165 |
nothing calls this directly
no test coverage detected