import ErrorBoundary from 'sentry/components/errorBoundary';
import ReplayTimeline from 'sentry/components/replays/breadcrumbs/replayTimeline';
import ReplayView from 'sentry/components/replays/replayView';
import useFullscreen from 'sentry/utils/replays/hooks/useFullscreen';
import Breadcrumbs from 'sentry/views/replays/detail/breadcrumbs';
import FocusArea from 'sentry/views/replays/detail/focusArea';
import FocusTabs from 'sentry/views/replays/detail/focusTabs';
import AsideTabsV2 from './asideTabs_v2';
import Container from './container';
import {
BreadcrumbSection,
ContentSection,
PageRow,
SIDEBAR_MIN_WIDTH,
SidebarSection,
TimelineSection,
TOPBAR_MIN_HEIGHT,
TopbarSection,
VideoSection,
} from './pageSections';
import ResizePanel from './resizePanel';
type Layout =
/**
* ### Sidebar
* ┌───────────────────┐
* │ Timeline │
* ├──────────┬────────┤
* │ Details > Video │
* │ > │
* │ >^^^^^^^^┤
* │ > Crumbs │
* │ > │
* └──────────┴────────┘
*/
| 'sidebar'
/**
* ### Topbar
*┌────────────────────┐
*│ Timeline │
*├───────────┬────────┤
*│ Video │ Crumbs │
*│ │ │
*├^^^^^^^^^^^^^^^^^^^^┤
*│ Details │
*│ │
*└────────────────────┘
*/
| 'topbar'
/**
* ### Sidebar Left
* ┌───────────────────┐
* │ Timeline │
* ├────────┬──────────┤
* │ Video > Details │
* │ > │
* │^^^^^^^ > |
* │ Crumbs > │
* │ > │
* └────────┴──────────┘
*/
| 'sidebar_left';
type Props = {
layout?: Layout;
showCrumbs?: boolean;
showTimeline?: boolean;
showVideo?: boolean;
};
function ReplayLayout({
layout = 'topbar',
showCrumbs = true,
showTimeline = true,
showVideo = true,
}: Props) {
const {ref: fullscreenRef, isFullscreen, toggle: toggleFullscreen} = useFullscreen();
const timeline = showTimeline ? (
) : null;
const video = showVideo ? (
) : null;
const crumbs = showCrumbs ? (
) : null;
const content = (
);
if (layout === 'sidebar') {
return (
{timeline}
{content}
);
}
if (layout === 'sidebar_left') {
return (
{timeline}
{content}
);
}
// layout === 'topbar' or default
return (
{timeline}
{video}
{crumbs}
{content}
);
}
export default ReplayLayout;