resources.tsx 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import styled from '@emotion/styled';
  2. import {IconDocs} from 'sentry/icons';
  3. import {t} from 'sentry/locale';
  4. import space from 'sentry/styles/space';
  5. import EventDataSection from '../../eventDataSection';
  6. export type ResourceLink = {
  7. link: string;
  8. text: string;
  9. };
  10. type Props = {
  11. description: string;
  12. links: ResourceLink[];
  13. };
  14. // This section provides users with resources on how to resolve an issue
  15. export function Resources(props: Props) {
  16. return (
  17. <EventDataSection type="resources-and-whatever" title={t('Resources and Whatever')}>
  18. {props.description}
  19. <LinkSection>
  20. {props.links.map(({link, text}) => (
  21. <a key={link} href={link} target="_blank" rel="noreferrer">
  22. <IconDocs /> {text}
  23. </a>
  24. ))}
  25. </LinkSection>
  26. </EventDataSection>
  27. );
  28. }
  29. const LinkSection = styled('div')`
  30. display: grid;
  31. grid-template-columns: 1fr 1fr;
  32. grid-row-gap: ${space(1)};
  33. @media (max-width: ${p => p.theme.breakpoints.small}) {
  34. grid-template-columns: 1fr;
  35. }
  36. margin-top: ${space(2)};
  37. a {
  38. display: flex;
  39. align-items: center;
  40. }
  41. svg {
  42. margin-right: ${space(1)};
  43. }
  44. `;