releaseDetailsSideTable.tsx 1003 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import styled from '@emotion/styled';
  2. import {space} from 'sentry/styles/space';
  3. type Props = {
  4. children?: React.ReactNode;
  5. type?: undefined | 'error' | 'warning';
  6. };
  7. export const ReleaseDetailsTable = styled('div')<{noMargin?: boolean}>`
  8. ${p => (p.noMargin ? 'margin-bottom: 0;' : null)}
  9. `;
  10. export function ReleaseDetailsTableRow({type, children}: Props) {
  11. return <Row type={type}>{children}</Row>;
  12. }
  13. const Row = styled('div')<{type: Props['type']}>`
  14. ${p => p.theme.overflowEllipsis};
  15. font-size: ${p => p.theme.fontSizeMedium};
  16. padding: ${space(0.5)} ${space(1)};
  17. font-weight: normal;
  18. line-height: inherit;
  19. background-color: ${p => {
  20. switch (p.type) {
  21. case 'error':
  22. return p.theme.red100 + ' !important';
  23. case 'warning':
  24. return 'var(--background-warning-default, rgba(245, 176, 0, 0.09)) !important';
  25. default:
  26. return 'inherit';
  27. }
  28. }};
  29. &:nth-of-type(2n-1) {
  30. background-color: ${p => p.theme.backgroundSecondary};
  31. }
  32. `;