import { useBridgeSyncState } from "./context";
const nothingState = {
    pending: false,
    error: null,
};
export function useAccountSyncState({ accountId, } = {}) {
    const syncState = useBridgeSyncState();
    return (accountId && syncState[accountId]) || nothingState;
}
export function useBatchAccountsSyncState({ accounts, } = {}) {
    const syncState = useBridgeSyncState();
    if (!accounts || !accounts?.length)
        return [];
    return accounts.reduce((acc, account) => {
        if (account) {
            acc.push({
                account,
                syncState: syncState[account.id] || nothingState,
            });
        }
        return acc;
    }, []);
}
//# sourceMappingURL=useAccountSyncState.js.map