descriptionCard.tsx 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import styled from '@emotion/styled';
  2. import {space} from 'sentry/styles/space';
  3. type Props = {
  4. children: React.ReactNode;
  5. description: React.ReactNode;
  6. title: string;
  7. };
  8. function DescriptionCard({title, description, children}: Props) {
  9. return (
  10. <Wrapper>
  11. <LeftPanel>
  12. <Title>{title}</Title>
  13. <Description>{description}</Description>
  14. </LeftPanel>
  15. <RightPanel>{children}</RightPanel>
  16. </Wrapper>
  17. );
  18. }
  19. export default DescriptionCard;
  20. const Wrapper = styled('div')`
  21. border: 1px solid ${p => p.theme.border};
  22. border-radius: ${p => p.theme.borderRadius};
  23. display: flex;
  24. margin-bottom: ${space(3)};
  25. flex-direction: column;
  26. @media (min-width: ${p => p.theme.breakpoints.medium}) {
  27. flex-direction: row;
  28. }
  29. `;
  30. const LeftPanel = styled('div')`
  31. padding: ${space(2)} ${space(2)};
  32. border-bottom: 1px solid ${p => p.theme.border};
  33. @media (min-width: ${p => p.theme.breakpoints.medium}) {
  34. max-width: 250px;
  35. border-right: 1px solid ${p => p.theme.border};
  36. border-bottom: 0;
  37. }
  38. `;
  39. const Title = styled('div')`
  40. font-size: ${p => p.theme.fontSizeLarge};
  41. margin: 0 0 ${space(0.5)};
  42. `;
  43. const Description = styled('div')`
  44. color: ${p => p.theme.subText};
  45. font-size: ${p => p.theme.fontSizeMedium};
  46. `;
  47. const RightPanel = styled('div')`
  48. flex-grow: 1;
  49. `;