item.tsx 1007 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import styled from '@emotion/styled';
  2. import classNames from 'classnames';
  3. import space from 'sentry/styles/space';
  4. type Props = {
  5. children: React.ReactNode;
  6. icon: React.ReactElement;
  7. className?: string;
  8. };
  9. const Item = ({children, icon, className}: Props) => (
  10. <Wrapper className={classNames('context-item', className)} data-test-id="context-item">
  11. {icon}
  12. {children && <Details>{children}</Details>}
  13. </Wrapper>
  14. );
  15. export default Item;
  16. const Details = styled('div')`
  17. display: flex;
  18. flex-direction: column;
  19. justify-content: center;
  20. max-width: 100%;
  21. min-height: 48px;
  22. `;
  23. const Wrapper = styled('div')`
  24. border-top: 1px solid ${p => p.theme.innerBorder};
  25. padding: ${space(0.5)} 0 ${space(0.5)} 40px;
  26. display: flex;
  27. align-items: center;
  28. position: relative;
  29. min-width: 0;
  30. @media (min-width: ${p => p.theme.breakpoints.small}) {
  31. :not(:last-child) {
  32. margin-right: ${space(3)};
  33. }
  34. max-width: 25%;
  35. border: 0;
  36. padding: 0px 0px 0px 42px;
  37. }
  38. `;