1
0
Fork 0
mirror of synced 2024-06-26 10:00:41 +12:00
budibase/examples/nextjs-api-sales/components/notifications.ts
2022-03-10 10:12:21 +00:00

29 lines
577 B
TypeScript

import { Store } from "react-notifications-component"
const notifications = {
error: (error: string, title: string) => {
Store.addNotification({
container: "top-right",
type: "danger",
message: error,
title: title,
dismiss: {
duration: 10000,
},
})
},
success: (message: string, title: string) => {
Store.addNotification({
container: "top-right",
type: "success",
message: message,
title: title,
dismiss: {
duration: 3000,
},
})
},
}
export default notifications