import React from 'react';
import { connect } from 'react-redux';
import { useState } from 'react';
import { NoContent, Tabs } from 'UI';
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.' }