panel.tsx 380 B

123456789101112131415
  1. import {decodeScalar} from 'sentry/utils/queryString';
  2. const DEFAULT_PANEL = 'duration';
  3. type Panel = 'duration' | 'status';
  4. export default function decode(value: string | string[] | undefined | null): Panel {
  5. switch (decodeScalar(value)) {
  6. case 'duration':
  7. return 'duration';
  8. case 'status':
  9. return 'status';
  10. default:
  11. return DEFAULT_PANEL;
  12. }
  13. }