storyHeader.tsx 702 B

12345678910111213141516171819202122232425262728
  1. import type {ComponentProps} from 'react';
  2. import styled from '@emotion/styled';
  3. import {Flex} from 'sentry/components/container/flex';
  4. import ThemeSwitcher from 'sentry/components/stories/themeSwitcher';
  5. import {IconSentry} from 'sentry/icons';
  6. import {space} from 'sentry/styles/space';
  7. interface Props extends ComponentProps<'div'> {}
  8. export default function StoryHeader({style}: Props) {
  9. return (
  10. <Flex as="header" justify="space-between" gap={space(2)} style={style}>
  11. <H1>
  12. <IconSentry size="xl" /> Component Library
  13. </H1>
  14. <ThemeSwitcher />
  15. </Flex>
  16. );
  17. }
  18. const H1 = styled('h1')`
  19. margin: 0;
  20. display: flex;
  21. gap: ${space(1)};
  22. align-items: center;
  23. `;