import { useRouter } from 'next/router'
import { observer } from 'mobx-react-lite'
import { Button, Dropdown, Divider, IconPlus } from '@supabase/ui'
import { useStore } from 'hooks'
import { IS_PLATFORM } from 'lib/constants'
const OrgDropdown = () => {
const router = useRouter()
const { app, ui } = useStore()
const sortedOrganizations: any[] = app.organizations.list()
const selectedOrganization: any = ui.selectedOrganization
return IS_PLATFORM ? (
{sortedOrganizations
.sort((a, b) => a.name.localeCompare(b.name))
.map((x) => (
router.push(`/org/${x.slug}/settings`)}>
{x.name}
))}
} onClick={() => router.push(`/new`)}>
New organization
>
}
>
) : (
)
}
export default observer(OrgDropdown)