123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- import styled from '@emotion/styled';
- import FieldHelp from 'sentry/components/forms/fieldGroup/fieldHelp';
- import {t} from 'sentry/locale';
- import {space} from 'sentry/styles/space';
- import type {Organization} from 'sentry/types';
- import {getRegionDataFromOrganization, shouldDisplayRegions} from 'sentry/utils/regions';
- import {DATA_STORAGE_DOCS_LINK} from 'sentry/views/organizationCreate';
- type Props = {
- organization?: Organization;
- };
- const OrganizationRegionInformationWrapper = styled('div')`
- margin-top: ${space(2)};
- text-align: end;
- `;
- const OrganizationFlag = styled('span')`
- font-size: ${p => p.theme.fontSizeLarge};
- `;
- export function OrganizationRegionAction({organization, ...props}: Props) {
- if (!organization || !shouldDisplayRegions()) {
- return null;
- }
- const regionData = getRegionDataFromOrganization(organization);
- if (!regionData) {
- return null;
- }
- return (
- <OrganizationRegionInformationWrapper {...props}>
- <div>
- {`${regionData.displayName} `}
- <OrganizationFlag>{regionData.flag}</OrganizationFlag>
- </div>
- <FieldHelp>
- {t("Your organization's data storage location. ")}
- <a href={DATA_STORAGE_DOCS_LINK}>{t('Learn More')}</a>
- </FieldHelp>
- </OrganizationRegionInformationWrapper>
- );
- }
|