groupPriority.stories.tsx 957 B

123456789101112131415161718192021222324252627282930313233343536
  1. import {useState} from 'react';
  2. import {
  3. GroupPriorityBadge,
  4. GroupPriorityDropdown,
  5. } from 'sentry/components/badge/groupPriority';
  6. import SideBySide from 'sentry/components/stories/sideBySide';
  7. import storyBook from 'sentry/stories/storyBook';
  8. import {PriorityLevel} from 'sentry/types/group';
  9. const PRIORITIES = [PriorityLevel.HIGH, PriorityLevel.MEDIUM, PriorityLevel.LOW];
  10. export const Badge = storyBook(GroupPriorityBadge, story => {
  11. story('Default', () => (
  12. <SideBySide>
  13. {PRIORITIES.map(priority => (
  14. <GroupPriorityBadge key={priority} priority={priority} />
  15. ))}
  16. </SideBySide>
  17. ));
  18. });
  19. export const Dropdown = storyBook(GroupPriorityDropdown, story => {
  20. story('Default', () => {
  21. const [value, setValue] = useState(PriorityLevel.MEDIUM);
  22. return (
  23. <GroupPriorityDropdown
  24. value={value}
  25. onChange={setValue}
  26. groupId="1"
  27. lastEditedBy="system"
  28. />
  29. );
  30. });
  31. });