index.tsx 768 B

1234567891011121314151617181920212223242526272829303132
  1. import type {Event} from '@sentry/types';
  2. import ClippedBox from 'sentry/components/clippedBox';
  3. import ContextBlock from 'sentry/components/events/contexts/contextBlock';
  4. import {t} from 'sentry/locale';
  5. type Props = {
  6. alias: string;
  7. data: Record<string, any>;
  8. event: Event;
  9. meta?: Record<string, any>;
  10. };
  11. export function getReduxContextData({data}: Pick<Props, 'data'>) {
  12. return [
  13. {
  14. key: 'value',
  15. subject: t('Latest State'),
  16. // TODO(TS): Objects cannot be rendered to the dom
  17. value: JSON.stringify(data),
  18. },
  19. ];
  20. }
  21. export function ReduxContext({data}: Props) {
  22. const reduxData = getReduxContextData({data});
  23. return (
  24. <ClippedBox clipHeight={250}>
  25. <ContextBlock data={reduxData} />
  26. </ClippedBox>
  27. );
  28. }