const React = require('react'); const PropTypes = require('prop-types'); const classnames = require('classnames'); const Icon = require('stremio-icons/dom'); const Notification = require('./Notification'); const NotificationPlaceholder = require('./NotificationPlaceholder'); const styles = require('./styles'); const NotificationsList = ({ className, metaItems }) => { return (
{ metaItems.map(({ req, content }, index) => { switch (content.type) { case 'Ready': return ( content.content.length > 0 ? content.content.map((notification) => { //notifications videos are not available in useCatalogs, but in useNotifications hook notification.videos = notification.videos || [{ thumbnail: 'https://www.stremio.com/website/home-testimonials.jpg', season: 1, episode: 1, released: new Date() }]; return ( notification.videos.length === 1 ? : ); }) :
No new notifications
); case 'Loading': return ( ); } }) }
); } NotificationsList.propTypes = { className: PropTypes.string, metaItems: PropTypes.arrayOf(PropTypes.object) }; module.exports = NotificationsList;