metricsExplorer.tsx 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import {useState} from 'react';
  2. import type {MRI} from 'sentry/types';
  3. import type {MetricWidgetQueryParams} from 'sentry/utils/metrics/types';
  4. import {MetricDisplayType} from 'sentry/utils/metrics/types';
  5. import {MetricWidget} from 'sentry/views/ddm/widget';
  6. // TODO(ddm): move this to admin
  7. export default function MetricsExplorer() {
  8. const [widget, setWidget] = useState<MetricWidgetQueryParams>({
  9. mri: '' as MRI,
  10. op: undefined,
  11. query: '',
  12. groupBy: [],
  13. displayType: MetricDisplayType.LINE,
  14. powerUserMode: true,
  15. showSummaryTable: true,
  16. sort: {name: 'name', order: 'asc'},
  17. title: undefined,
  18. });
  19. return (
  20. <MetricWidget
  21. widget={{
  22. ...widget,
  23. }}
  24. isSelected={false}
  25. onSelect={() => {}}
  26. onChange={(_, data) => {
  27. setWidget(curr => ({...curr, ...data}));
  28. }}
  29. index={0}
  30. datetime={{
  31. start: null,
  32. end: null,
  33. period: '7d',
  34. utc: false,
  35. }}
  36. projects={[]}
  37. environments={[]}
  38. hasSiblings={false}
  39. />
  40. );
  41. }