{tab && tab.icon && (
)}
{t(tab.name)}
{teams &&
teamMenuState &&
teams.map((team, index: number) => {
if (!teamMenuState[index]) {
return null;
}
if (teamMenuState.some((teamState) => teamState.teamId === team.id))
return (
setTeamMenuState([
...teamMenuState,
(teamMenuState[index] = {
...teamMenuState[index],
teamMenuOpen: !teamMenuState[index].teamMenuOpen,
}),
])
}>
setTeamMenuState([
...teamMenuState,
(teamMenuState[index] = {
...teamMenuState[index],
teamMenuOpen: !teamMenuState[index].teamMenuOpen,
}),
])
}>
{teamMenuState[index].teamMenuOpen ? (
) : (
)}
{team.name}
{!team.accepted && (
Inv.
)}
{team.accepted && (
)}
{(team.role === MembershipRole.OWNER ||
team.role === MembershipRole.ADMIN ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore this exists wtf?
(team.isOrgAdmin && team.isOrgAdmin)) && (
<>
{/* TODO */}
{/* */}
{/* Hide if there is a parent ID */}
{!team.parentId ? (
<>
{HOSTED_CAL_FEATURES && (
)}
>
) : null}
>
)}
);
})}
{(!currentOrg || (currentOrg && currentOrg?.user?.role !== "MEMBER")) && (
)}