feat(admin, admin-ui, medusa-js, medusa-react, medusa): Support Admin Extensions (#4761)
Co-authored-by: Rares Stefan <948623+StephixOne@users.noreply.github.com> Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
26c78bbc03
commit
f1a05f4725
25
packages/admin-ui/ui/src/hooks/use-extension-base-props.tsx
Normal file
25
packages/admin-ui/ui/src/hooks/use-extension-base-props.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import { Notify } from "../types/extensions"
|
||||
import useNotification from "./use-notification"
|
||||
|
||||
export const useExtensionBaseProps = () => {
|
||||
const notification = useNotification()
|
||||
|
||||
const notify: Notify = {
|
||||
success: (title: string, message: string) => {
|
||||
notification(title, message, "success")
|
||||
},
|
||||
error: (title: string, message: string) => {
|
||||
notification(title, message, "error")
|
||||
},
|
||||
warn: (title: string, message: string) => {
|
||||
notification(title, message, "warning")
|
||||
},
|
||||
info: (title: string, message: string) => {
|
||||
notification(title, message, "info")
|
||||
},
|
||||
}
|
||||
|
||||
return {
|
||||
notify,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user