selectedOption.tsx 790 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import styled from '@emotion/styled';
  2. import TextOverflow from 'sentry/components/textOverflow';
  3. import {t, tct} from 'sentry/locale';
  4. import space from 'sentry/styles/space';
  5. type Props = {
  6. details: ThreadInfo;
  7. id: number;
  8. };
  9. type ThreadInfo = {
  10. filename?: string;
  11. label?: string;
  12. };
  13. const SelectedOption = ({id, details}: Props) => (
  14. <Wrapper>
  15. <ThreadId>{tct('Thread #[id]:', {id})}</ThreadId>
  16. <Label>{details?.label || `<${t('unknown')}>`}</Label>
  17. </Wrapper>
  18. );
  19. export default SelectedOption;
  20. const Wrapper = styled('div')`
  21. grid-template-columns: auto 1fr;
  22. display: grid;
  23. `;
  24. const ThreadId = styled(TextOverflow)`
  25. padding-right: ${space(1)};
  26. max-width: 100%;
  27. text-align: left;
  28. `;
  29. const Label = styled(ThreadId)`
  30. color: ${p => p.theme.blue300};
  31. `;