Skip to content

Commit

Permalink
add stories to see what it looks like
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Feb 14, 2024
1 parent b82d8a0 commit 73cae47
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { Meta } from '@storybook/react'
import {
BodyDisplay,
HeadersDisplay,
ItemPerformanceEvent,
} from 'scenes/session-recordings/player/inspector/components/ItemPerformanceEvent'

import { mswDecorator } from '~/mocks/browser'

const meta: Meta<typeof ItemPerformanceEvent> = {
title: 'Components/ItemPerformanceEvent',
component: ItemPerformanceEvent,
decorators: [
mswDecorator({
get: {},
}),
],
}
export default meta

export function InitialHeadersDisplay(): JSX.Element {
return <HeadersDisplay request={undefined} response={undefined} isInitial={true} />
}

export function InitialBodyDisplay(): JSX.Element {
return (
<BodyDisplay
content={undefined}
headers={undefined}
emptyMessage="Response captured before PostHog was initialized"
/>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ export function ItemPerformanceEvent({
headers={item.request_headers}
emptyMessage={
item.is_initial
? 'captured before PostHog was initialized'
? 'Request captured before PostHog was initialized'
: 'No request body captured'
}
/>
Expand All @@ -393,7 +393,7 @@ export function ItemPerformanceEvent({
headers={item.response_headers}
emptyMessage={
item.is_initial
? 'captured before PostHog was initialized'
? 'Response captured before PostHog was initialized'
: 'No response body captured'
}
/>
Expand Down Expand Up @@ -433,7 +433,7 @@ export function ItemPerformanceEvent({
)
}

function BodyDisplay({
export function BodyDisplay({
content,
headers,
emptyMessage,
Expand Down Expand Up @@ -463,7 +463,7 @@ function BodyDisplay({
)
}

function HeadersDisplay({
export function HeadersDisplay({
request,
response,
isInitial,
Expand Down

0 comments on commit 73cae47

Please sign in to comment.