import { connect } from 'react-redux'; import { useState } from 'react'; import { NoContent, Tabs } from 'UI'; import withEnumToggle from 'HOCs/withEnumToggle'; import { hideHint } from 'Duck/components/player'; import { typeList } from 'Types/session/stackEvent'; import * as PanelLayout from './PanelLayout'; import UserEvent from 'Components/Session_/StackEvents/UserEvent'; import Autoscroll from 'Components/Session_/Autoscroll'; const ALL = 'ALL'; const TABS = [ ALL, ...typeList ].map(tab =>({ text: tab, key: tab })); function StackEvents({ stackEvents, hintIsHidden, hideHint, }) { const [ activeTab, setTab ] = useState(ALL); const tabs = TABS.filter(({ key }) => key === ALL || stackEvents.some(({ source }) => key === source)); // Do it once for all when we show them all const filteredStackEvents = stackEvents .filter(({ source }) => activeTab === ALL || activeTab === source); return ( <> Integrations {' and '} Events { ' make debugging easier. Sync your backend logs and custom events with session replay.' }

: null } size="small" show={ filteredStackEvents.length === 0 } > { filteredStackEvents.map(userEvent => ( ))}
); } export default connect(state => ({ hintIsHidden: state.getIn(['components', 'player', 'hiddenHints', 'stack']) || !state.getIn([ 'user', 'client', 'sites' ]).some(s => s.stackIntegrations), }), { hideHint })(StackEvents);