@@ -22,10 +22,13 @@ import {
22
22
import AutoSizer from 'react-virtualized-auto-sizer' ;
23
23
import { useQuery } from 'urql' ;
24
24
import { GraphQLHighlight } from '@/components/common/GraphQLSDLBlock' ;
25
+ import { NotFoundContent } from '@/components/common/not-found-content' ;
25
26
import { Page , TargetLayout } from '@/components/layouts/target' ;
26
27
import { Badge } from '@/components/ui/badge' ;
27
28
import { Button } from '@/components/ui/button' ;
29
+ import { CardDescription } from '@/components/ui/card' ;
28
30
import { Meta } from '@/components/ui/meta' ;
31
+ import { SubPageLayoutHeader } from '@/components/ui/page-content-layout' ;
29
32
import { ResizableHandle , ResizablePanel , ResizablePanelGroup } from '@/components/ui/resizable' ;
30
33
import { ScrollArea } from '@/components/ui/scroll-area' ;
31
34
import {
@@ -36,6 +39,7 @@ import {
36
39
SheetHeader ,
37
40
SheetTitle ,
38
41
} from '@/components/ui/sheet' ;
42
+ import { Skeleton } from '@/components/ui/skeleton' ;
39
43
import { Tooltip , TooltipContent , TooltipProvider , TooltipTrigger } from '@/components/ui/tooltip' ;
40
44
import { FragmentType , graphql , useFragment } from '@/gql' ;
41
45
import { useClipboard } from '@/lib/hooks' ;
@@ -1010,19 +1014,53 @@ function TargetInsightsNewPageContent(props: {
1010
1014
} ,
1011
1015
} ) ;
1012
1016
1013
- if ( ! result . data ?. target ?. trace ) {
1014
- return null ;
1015
- }
1016
-
1017
1017
return (
1018
- < TraceSheet
1019
- organizationSlug = { props . organizationSlug }
1020
- projectSlug = { props . projectSlug }
1021
- targetSlug = { props . targetSlug }
1022
- trace = { result . data . target . trace }
1023
- activeSpanId = { props . activeSpanId }
1024
- activeSpanTab = { props . activeSpanTab }
1025
- />
1018
+ < div className = "flex h-full flex-col space-y-4 pt-6" >
1019
+ < Meta title = { `Trace ${ props . traceId } ` } />
1020
+ < SubPageLayoutHeader
1021
+ subPageTitle = {
1022
+ < span className = "flex items-center" >
1023
+ < Link
1024
+ to = "/$organizationSlug/$projectSlug/$targetSlug/traces"
1025
+ params = { {
1026
+ organizationSlug : props . organizationSlug ,
1027
+ projectSlug : props . projectSlug ,
1028
+ targetSlug : props . targetSlug ,
1029
+ } }
1030
+ >
1031
+ Traces
1032
+ </ Link > { ' ' }
1033
+ < span className = "inline-block px-2 italic text-gray-500" > /</ span > { ' ' }
1034
+ { result . data ?. target ?. trace ? (
1035
+ result . data . target . trace . id
1036
+ ) : (
1037
+ < Skeleton className = "inline-block h-5 w-[150px]" />
1038
+ ) }
1039
+ </ span >
1040
+ }
1041
+ description = {
1042
+ < >
1043
+ < CardDescription > Insights into the requests made to your GraphQL API.</ CardDescription >
1044
+ </ >
1045
+ }
1046
+ />
1047
+ { result . data ?. target ?. trace && (
1048
+ < TraceSheet
1049
+ organizationSlug = { props . organizationSlug }
1050
+ projectSlug = { props . projectSlug }
1051
+ targetSlug = { props . targetSlug }
1052
+ trace = { result . data . target . trace }
1053
+ activeSpanId = { props . activeSpanId }
1054
+ activeSpanTab = { props . activeSpanTab }
1055
+ />
1056
+ ) }
1057
+ { ! result . data ?. target ?. trace && ! result . fetching && (
1058
+ < >
1059
+ < Meta title = "Trace Not found" />
1060
+ < NotFoundContent heading = "Trace not found." subheading = "This trace does not exist." />
1061
+ </ >
1062
+ ) }
1063
+ </ div >
1026
1064
) ;
1027
1065
}
1028
1066
@@ -1036,7 +1074,6 @@ export function TargetTracePage(props: {
1036
1074
} ) {
1037
1075
return (
1038
1076
< >
1039
- < Meta title = { `Trace ${ props . traceId } ` } />
1040
1077
< TargetLayout
1041
1078
organizationSlug = { props . organizationSlug }
1042
1079
projectSlug = { props . projectSlug }
0 commit comments