import Container from "@mui/material/Container"; import {CardContent, Link, Stack} from "@mui/material"; import Card from "@mui/material/Card"; import Typography from "@mui/material/Typography"; import * as React from "react"; import {formatMessage, formatTitle, unmatchedTags} from "../app/utils"; import IconButton from "@mui/material/IconButton"; import CloseIcon from '@mui/icons-material/Close'; import {Paragraph, VerticallyCenteredContainer} from "./styles"; const Notifications = (props) => { const subscription = props.subscription; const sortedNotifications = subscription.getNotifications() .sort((a, b) => a.time < b.time ? 1 : -1); if (sortedNotifications.length === 0) { return ; } return ( {sortedNotifications.map(notification => props.onDeleteNotification(subscription.id, notificationId)} />)} ); } const NotificationItem = (props) => { const notification = props.notification; const date = new Intl.DateTimeFormat('default', {dateStyle: 'short', timeStyle: 'short'}) .format(new Date(notification.time * 1000)); const otherTags = unmatchedTags(notification.tags); const tags = (otherTags.length > 0) ? otherTags.join(', ') : null; return ( props.onDelete(notification.id)} sx={{ float: 'right', marginRight: -1, marginTop: -1 }}> {date} {[1,2,4,5].includes(notification.priority) && {`Priority} {notification.title && {formatTitle(notification)}} {formatMessage(notification)} {tags && Tags: {tags}} ); } const NothingHereYet = (props) => { return ( No notifications
You haven't received any notifications for this topic yet.
To send notifications to this topic, simply PUT or POST to the topic URL. Example:
$ curl -d "Hi" {props.subscription.shortUrl()}
For more detailed instructions, check out the website or {" "}documentation.
); }; export default Notifications;