replayTimeline.stories.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import styled from '@emotion/styled';
  2. import ReplayTimeline from 'sentry/components/replays/breadcrumbs/replayTimeline';
  3. import {Provider as ReplayContextProvider} from 'sentry/components/replays/replayContext';
  4. import {EntryType} from 'sentry/types/event';
  5. // TODO these two sets of example data are not from the same replay!
  6. import breadcrumbs from './example_breadcrumbs.json';
  7. import rrwebEvents1 from './example_rrweb_events_1.json';
  8. export default {
  9. title: 'Components/Replays/ReplayTimeline',
  10. component: ReplayTimeline,
  11. };
  12. const ManualResize = styled('div')`
  13. resize: both;
  14. overflow: auto;
  15. border: 1px solid ${p => p.theme.gray100};
  16. `;
  17. const Template = ({...args}) => (
  18. <ReplayContextProvider value={{duration: 25710}} events={rrwebEvents1}>
  19. <ManualResize>
  20. <ReplayTimeline {...args} />
  21. </ManualResize>
  22. </ReplayContextProvider>
  23. );
  24. export const _ReplayTimeline = Template.bind({});
  25. _ReplayTimeline.args = {
  26. data: breadcrumbs,
  27. type: EntryType.BREADCRUMBS,
  28. };
  29. _ReplayTimeline.parameters = {
  30. docs: {
  31. description: {
  32. story:
  33. 'ReplayTimeline is a component that contains play/pause buttons for the replay timeline',
  34. },
  35. },
  36. };