import styled from '@emotion/styled'; import SelectControl from 'sentry/components/forms/controls/selectControl'; import OrganizationBadge from 'sentry/components/idBadge/organizationBadge'; import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import type {Organization} from 'sentry/types'; type OrganizationSelectHeaderProps = { handleOrgChange: (orgId: string) => void; organizationId: string | undefined; organizations: Organization[]; }; export function OrganizationSelectHeader({ handleOrgChange, organizationId, organizations, }: OrganizationSelectHeaderProps) { return ( {t('Settings for Organization')} { return { label: org.name, value: org.id, leadingItems: ( ), }; })} onChange={option => handleOrgChange(option.value)} value={organizationId} styles={{ container: (provided: Record) => ({ ...provided, minWidth: `200px`, }), }} /> ); } // Resetting styles because its in a panel header const StyledSelectControl = styled(SelectControl)` text-transform: initial; font-weight: normal; `; const OrgControlWrapper = styled('div')` display: flex; align-items: center; gap: ${space(1)}; flex-grow: 1; `;