import Container from "@mui/material/Container"; import {CardContent, Stack} from "@mui/material"; import Card from "@mui/material/Card"; import Typography from "@mui/material/Typography"; import * as React from "react"; const NotificationList = (props) => { const sortedNotifications = props.notifications.sort((a, b) => a.time < b.time); return ( {sortedNotifications.map(notification => )} ); } const NotificationItem = (props) => { const notification = props.notification; const date = new Intl.DateTimeFormat('default', {dateStyle: 'short', timeStyle: 'short'}) .format(new Date(notification.time * 1000)); const tags = (notification.tags && notification.tags.length > 0) ? notification.tags.join(', ') : null; return ( {date} {notification.title && {notification.title}} {notification.message} {tags && Tags: {tags}} ); } export default NotificationList;