import React from 'react'; import PropTypes from 'prop-types'; import DVHeader from './DVHeader'; import DVBody from './DVBody'; import DVFooter from './DVFooter'; import Spinner from '../../Spinner'; import Div100vh from 'react-div-100vh'; import { useSelector } from 'react-redux' const CIDetailView = ({ activeItem, isFirst, isLast, close, catalog, pending, openDetail, showNextItem, showPrevItem, match, participated, sendParticipation, toggleParticipated, color }) => { if (activeItem === null) { // we have the catalog, but this view was not opened through an action // but by it's URL. Now we need to dispatch an action that, // depending on the current route, will tell which id the ID of the item to display. if (catalog.length) { catalog.forEach((item, i) => { if (item.inventory_number === match.params.itemId.replace('__', ' ')) { openDetail(i); } }); } // we don't know yet what data to display. // Most certainly the catalog is being fetched. return (