feat(admin,admin-ui,medusa): Add Medusa Admin plugin (#3334)
This commit is contained in:
committed by
GitHub
parent
d6b1ad1ccd
commit
40de54b010
21
packages/admin-ui/ui/src/hooks/use-notification.tsx
Normal file
21
packages/admin-ui/ui/src/hooks/use-notification.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import React from "react"
|
||||
import { toast } from "react-hot-toast"
|
||||
import Notification, {
|
||||
NotificationTypes,
|
||||
} from "../components/atoms/notification"
|
||||
|
||||
const useNotification = () => {
|
||||
return (title: string, message: string, type: NotificationTypes) => {
|
||||
toast.custom(
|
||||
(t) => (
|
||||
<Notification toast={t} type={type} title={title} message={message} />
|
||||
),
|
||||
{
|
||||
position: "top-right",
|
||||
duration: 3000,
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default useNotification
|
||||
Reference in New Issue
Block a user