metricsExplorer.tsx 1008 B

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