import {Fragment} from 'react'; import styled from '@emotion/styled'; import {openCreateTeamModal} from 'sentry/actionCreators/modal'; import {Button} from 'sentry/components/button'; import EmptyMessage from 'sentry/components/emptyMessage'; import {t, tct} from 'sentry/locale'; import type {Organization, Team} from 'sentry/types'; import TextBlock from 'sentry/views/settings/components/text/textBlock'; import AllTeamsRow from './allTeamsRow'; type Props = { access: Record; openMembership: boolean; organization: Organization; teamList: Array; }; function AllTeamsList({organization, openMembership, teamList, access}: Props) { const teamNodes = teamList.map(team => ( )); if (!teamNodes.length) { const canCreateTeam = access.has('project:admin'); return ( {tct('No teams here. [teamCreate]', { root: , teamCreate: canCreateTeam ? tct('You can always [link:create one].', { link: ( openCreateTeamModal({ organization, }) } aria-label={t('Create team')} /> ), }) : null, })} ); } return {teamNodes}; } export default AllTeamsList; const StyledButton = styled(Button)` font-size: ${p => p.theme.fontSizeLarge}; `;