mango-ui-v2/utils/notifications.tsx

18 lines
374 B
TypeScript

import useMangoStore from '../stores/useMangoStore'
export function notify(newNotification: {
type?: string
message: string
description?: string
txid?: string
}) {
const setMangoStore = useMangoStore.getState().set
setMangoStore((state) => {
state.notifications = [
...state.notifications,
{ type: 'success', ...newNotification },
]
})
}