/** @jsx jsx */ import { jsx } from '@emotion/core' import { App, Organization } from '@aragon/connect' import Group from './Group' import Table from './Table' import TextButton from './TextButton' import { useCancellableAsync } from './generic-hooks' type Props = { org?: Organization onOpenApp: (address: string) => void } export default function OrgApps({ onOpenApp, org }: Props) { const [apps = [], loading] = useCancellableAsync( async () => (org ? org.apps() : []), [org] ) return ( (a.name || '').localeCompare(b.name || '')) .map((app: App) => [ app.name || 'unknown', app.version || '?', onOpenApp(app.address)}> {app.address.slice(0, 6)} , ])} /> ) }