metricsExplorer.tsx 1011 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. sort: {name: 'name', order: 'asc'},
  16. });
  17. return (
  18. <MetricWidget
  19. widget={{
  20. ...widget,
  21. }}
  22. isSelected={false}
  23. onSelect={() => {}}
  24. onChange={(_, data) => {
  25. setWidget(curr => ({...curr, ...data}));
  26. }}
  27. index={0}
  28. datetime={{
  29. start: null,
  30. end: null,
  31. period: '7d',
  32. utc: false,
  33. }}
  34. projects={[]}
  35. environments={[]}
  36. hasSiblings={false}
  37. />
  38. );
  39. }