import React from 'react'; import { Icon, Tooltip, Button } from 'UI'; import Autoplay from './Autoplay'; import Bookmark from 'Shared/Bookmark'; import SharePopup from '../shared/SharePopup/SharePopup'; import copy from 'copy-to-clipboard'; import Issues from './Issues/Issues'; import NotePopup from './components/NotePopup'; import { connectPlayer, pause } from 'Player'; import ItemMenu from './components/HeaderMenu'; import { useModal } from 'App/components/Modal'; import BugReportModal from './BugReport/BugReportModal'; function SubHeader(props) { const [isCopied, setCopied] = React.useState(false); const { showModal, hideModal } = useModal(); const isAssist = window.location.pathname.includes('/assist/'); const location = props.currentLocation && props.currentLocation.length > 60 ? `${props.currentLocation.slice(0, 60)}...` : props.currentLocation; const showReportModal = () => { pause(); const xrayProps = { currentLocation: props.currentLocation, resourceList: props.resourceList, exceptionsList: props.exceptionsList, eventsList: props.eventsList, endTime: props.endTime, } showModal(, { right: true }); }; return (
{location && (
{ copy(props.currentLocation); setCopied(true); setTimeout(() => setCopied(false), 5000); }} > {location}
)} {!isAssist ? (
), }, { key: 3, component: ( Share
} /> ), }, { key: 4, component: , }, ]} />
) : null} ); } const SubH = connectPlayer( (state) => ({ width: state.width, height: state.height, currentLocation: state.location, resourceList: state.resourceList .filter((r) => r.isRed() || r.isYellow()) .concat(state.fetchList.filter((i) => parseInt(i.status) >= 400)) .concat(state.graphqlList.filter((i) => parseInt(i.status) >= 400)), exceptionsList: state.exceptionsList, eventsList: state.eventList, endTime: state.endTime, }) )(SubHeader); export default React.memo(SubH);