| 12345678910111213141516171819202122 |
- import { Icon, Notification as _Notification } from "tiny-ui";
- const Notification = ({ type, ...props }) => {
- let payload = { ...props, placement: "bottomRight" };
- if (type && ["info", "success", "warning", "error"].includes(type)) {
- _Notification[type](payload);
- } else if (type && ["loader", "loading"].includes(type)) {
- payload.icon = (
- <Icon name="loader" size={32} style={{ marginRight: "1rem" }} spin />
- );
- _Notification.open(payload);
- } else if (type && ["announce", "announcement"].includes(type)) {
- payload.icon = (
- <Icon name="broadcast" size={32} style={{ marginRight: "1rem" }} />
- );
- _Notification.open(payload);
- } else {
- _Notification.open(payload);
- }
- };
- export default Notification;
|