diff --git a/centrifuge-app/src/utils/usePermissions.ts b/centrifuge-app/src/utils/usePermissions.tsx similarity index 91% rename from centrifuge-app/src/utils/usePermissions.ts rename to centrifuge-app/src/utils/usePermissions.tsx index 2fbf758210..14485de44b 100644 --- a/centrifuge-app/src/utils/usePermissions.ts +++ b/centrifuge-app/src/utils/usePermissions.tsx @@ -6,8 +6,9 @@ import { isSameAddress, PoolRoles, } from '@centrifuge/centrifuge-js' -import { useCentrifugeQuery, useWallet } from '@centrifuge/centrifuge-react' -import { useMemo } from 'react' +import { truncateAddress, useCentrifugeQuery, useCentrifugeUtils, useWallet } from '@centrifuge/centrifuge-react' +import { Select } from '@centrifuge/fabric' +import * as React from 'react' import { combineLatest, filter, map, repeatWhen, switchMap } from 'rxjs' import { diffPermissions } from '../pages/IssuerPool/Configuration/Admins' import { useCollections } from './useCollections' @@ -106,6 +107,28 @@ type SuitableConfig = { proxyType?: string[] | ((accountProxyTypes: string[]) => boolean) } +export function useSuitableAccountPicker(config: SuitableConfig) { + const accounts = useSuitableAccounts(config) + const [account, setAccount] = React.useState(accounts[0]) + const utils = useCentrifugeUtils() + + const pickerElement = + accounts?.length > 1 ? ( +