organizationBadge.tsx 747 B

1234567891011121314151617181920212223242526272829303132
  1. import type {Organization} from 'sentry/types';
  2. import BadgeDisplayName from './badgeDisplayName';
  3. import {BaseBadge, type BaseBadgeProps} from './baseBadge';
  4. export interface OrganizationBadgeProps extends BaseBadgeProps {
  5. organization: Organization;
  6. /**
  7. * When true will default max-width, or specify one as a string
  8. */
  9. hideOverflow?: boolean | string;
  10. }
  11. function OrganizationBadge({
  12. hideOverflow = true,
  13. organization,
  14. ...props
  15. }: OrganizationBadgeProps) {
  16. return (
  17. <BaseBadge
  18. displayName={
  19. <BadgeDisplayName hideOverflow={hideOverflow}>
  20. {organization.slug}
  21. </BadgeDisplayName>
  22. }
  23. organization={organization}
  24. {...props}
  25. />
  26. );
  27. }
  28. export default OrganizationBadge;