mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-27 14:21:00 +00:00
28 lines
616 B
JavaScript
28 lines
616 B
JavaScript
'use client';
|
|
'use strict';
|
|
|
|
const positions = [
|
|
"bottom-center",
|
|
"bottom-left",
|
|
"bottom-right",
|
|
"top-center",
|
|
"top-left",
|
|
"top-right"
|
|
];
|
|
function getGroupedNotifications(notifications, defaultPosition) {
|
|
return notifications.reduce(
|
|
(acc, notification) => {
|
|
acc[notification.position || defaultPosition].push(notification);
|
|
return acc;
|
|
},
|
|
positions.reduce((acc, item) => {
|
|
acc[item] = [];
|
|
return acc;
|
|
}, {})
|
|
);
|
|
}
|
|
|
|
exports.getGroupedNotifications = getGroupedNotifications;
|
|
exports.positions = positions;
|
|
//# sourceMappingURL=get-grouped-notifications.cjs.map
|