mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-05-04 02:34:52 +00:00
Update frontends/nextjs/src/components/ui/sonner.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -2,7 +2,24 @@
|
||||
|
||||
/**
|
||||
* Sonner-compatible toast API using MUI Snackbar
|
||||
* Provides a drop-in replacement for the 'sonner' package
|
||||
* Provides a drop-in replacement for the 'sonner' package.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* ```tsx
|
||||
* import { Toaster, toast } from '@/components/ui/sonner'
|
||||
*
|
||||
* function App() {
|
||||
* return (
|
||||
* <>
|
||||
* <button onClick={() => toast('Default message')}>Show default toast</button>
|
||||
* <button onClick={() => toast.success('Saved!')}>Show success toast</button>
|
||||
* <button onClick={() => toast.error('Failed to save')}>Show error toast</button>
|
||||
* <Toaster />
|
||||
* </>
|
||||
* )
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
|
||||
import React, { createContext, useCallback, useContext, useEffect, useState } from 'react'
|
||||
|
||||
Reference in New Issue
Block a user