{organizations ? (
organizations
.sort((a, b) => {
// sort demo org to the bottom
const isDemoA = env.NEXT_PUBLIC_DEMO_ORG_ID === a.id;
const isDemoB = env.NEXT_PUBLIC_DEMO_ORG_ID === b.id;
if (isDemoA) return 1;
if (isDemoB) return -1;
return 0;
})
.map((dropdownOrg) => (
{env.NEXT_PUBLIC_DEMO_ORG_ID === dropdownOrg.id && (
)}
{dropdownOrg.name}
))
) : (
)}
{canCreateOrganizations && (
<>