import { useQuery } from '@tanstack/react-query';
import { useSeamClient } from '../../../lib/seam/use-seam-client.js';
export function useConnectedAccount(params) {
    const normalizedParams = typeof params === 'string' ? { connected_account_id: params } : params;
    const { client } = useSeamClient();
    const { data, ...rest } = useQuery({
        enabled: client != null,
        queryKey: ['connected_accounts', 'get', normalizedParams],
        queryFn: async () => {
            if (client == null)
                return null;
            return await client.connectedAccounts.get(normalizedParams);
        },
    });
    return { ...rest, connectedAccount: data };
}
//# sourceMappingURL=use-connected-account.js.map