Skip to content

Commit 675da01

Browse files
committed
empty state events
1 parent 87e2a2a commit 675da01

File tree

1 file changed

+36
-30
lines changed

1 file changed

+36
-30
lines changed

packages/web/app/src/pages/target-trace.tsx

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -922,36 +922,42 @@ export function TraceSheet(props: TraceSheetProps) {
922922
{activeView === 'events' ? (
923923
<div className="p-4">
924924
<div className="space-y-2">
925-
{events.map(event => (
926-
<Link
927-
to="/$organizationSlug/$projectSlug/$targetSlug/trace/$traceId"
928-
params={{
929-
organizationSlug: props.organizationSlug,
930-
projectSlug: props.projectSlug,
931-
targetSlug: props.targetSlug,
932-
traceId: trace.id,
933-
}}
934-
search={{ activeSpanId: event.spanId, activeSpanTab: 'events' }}
935-
onMouseOver={() =>
936-
setHighlightedEvent({
937-
spanId: event.spanId,
938-
eventId: event.id,
939-
})
940-
}
941-
onMouseLeave={() => {
942-
setHighlightedEvent(null);
943-
}}
944-
className="mb-2 block"
945-
key={event.id}
946-
>
947-
<ExceptionTeaser
948-
type={String(event.attributes['exception.type'] ?? '')}
949-
message={String(event.attributes['exception.message'] ?? '')}
950-
stacktrace={String(event.attributes['exception.stacktrace'] ?? '')}
951-
name={event.name}
952-
/>
953-
</Link>
954-
))}
925+
{!events.length ? (
926+
<div className="text-sm text-gray-600">
927+
No events occured during this trace.
928+
</div>
929+
) : (
930+
events.map(event => (
931+
<Link
932+
to="/$organizationSlug/$projectSlug/$targetSlug/trace/$traceId"
933+
params={{
934+
organizationSlug: props.organizationSlug,
935+
projectSlug: props.projectSlug,
936+
targetSlug: props.targetSlug,
937+
traceId: trace.id,
938+
}}
939+
search={{ activeSpanId: event.spanId, activeSpanTab: 'events' }}
940+
onMouseOver={() =>
941+
setHighlightedEvent({
942+
spanId: event.spanId,
943+
eventId: event.id,
944+
})
945+
}
946+
onMouseLeave={() => {
947+
setHighlightedEvent(null);
948+
}}
949+
className="mb-2 block"
950+
key={event.id}
951+
>
952+
<ExceptionTeaser
953+
type={String(event.attributes['exception.type'] ?? '')}
954+
message={String(event.attributes['exception.message'] ?? '')}
955+
stacktrace={String(event.attributes['exception.stacktrace'] ?? '')}
956+
name={event.name}
957+
/>
958+
</Link>
959+
))
960+
)}
955961
</div>
956962
</div>
957963
) : null}

0 commit comments

Comments
 (0)