fieldDescription.tsx 596 B

12345678910111213141516171819202122232425262728
  1. import {css} from '@emotion/react';
  2. import styled from '@emotion/styled';
  3. import space from 'sentry/styles/space';
  4. import {FieldGroupProps} from './types';
  5. type FieldDescriptionProps = Pick<FieldGroupProps, 'inline'>;
  6. const inlineStyle = (p: FieldDescriptionProps) =>
  7. p.inline
  8. ? css`
  9. width: 50%;
  10. padding-right: 10px;
  11. flex-shrink: 0;
  12. `
  13. : css`
  14. margin-bottom: ${space(1)};
  15. `;
  16. const FieldDescription = styled('label')<FieldDescriptionProps>`
  17. font-weight: normal;
  18. margin-bottom: 0;
  19. ${inlineStyle};
  20. `;
  21. export default FieldDescription;