import {Fragment} from 'react';
import type {RouteComponentProps} from 'react-router';
import DetailedError from 'sentry/components/errors/detailedError';
import NotFound from 'sentry/components/errors/notFound';
import List from 'sentry/components/list';
import ListItem from 'sentry/components/list/listItem';
import {
Provider as ReplayContextProvider,
useReplayContext,
} from 'sentry/components/replays/replayContext';
import {t} from 'sentry/locale';
import {PageContent} from 'sentry/styles/organization';
import useReplayData from 'sentry/utils/replays/hooks/useReplayData';
import useReplayLayout from 'sentry/utils/replays/hooks/useReplayLayout';
import useReplayPageview from 'sentry/utils/replays/hooks/useReplayPageview';
import Layout from 'sentry/views/replays/detail/layout';
import Page from 'sentry/views/replays/detail/page';
import type {ReplayRecord} from 'sentry/views/replays/types';
type Props = RouteComponentProps<
{orgId: string; replaySlug: string},
{},
any,
{t: number}
>;
function ReplayDetails({
location: {
query: {
t: initialTimeOffset, // Time, in seconds, where the video should start
},
},
params: {orgId: orgSlug, replaySlug},
}: Props) {
useReplayPageview();
const {fetching, onRetry, replay, replayRecord, fetchError} = useReplayData({
replaySlug,
orgSlug,
});
if (!fetching && !replay && fetchError) {
if (fetchError.statusText === 'Not Found') {
return (
);
}
const reasons = [
t('The Replay is still processing and is on its way'),
t('There is an internal systems error or active issue'),
];
return (