import { useInterestRatesByCurrencies } from "../../dada-client/hooks/useInterestRatesByCurrencies";
import { getInterestRateForAsset } from "../utils/getInterestRateForAsset";
export function useLeftAccountsApyModule(params, useAccountData, accountsCountAndApy, accountsApy) {
    const { networks } = params;
    const accountData = useAccountData(params);
    const interestRates = useInterestRatesByCurrencies(networks);
    // Map each account to its APY info using the shared utility
    return accountData.map(({ asset, label, count }) => {
        const { interestRate, interestRatePercentageRounded } = getInterestRateForAsset(asset, interestRates, networks);
        if ((!interestRate || interestRatePercentageRounded <= 0) && count <= 0) {
            return {
                count,
            };
        }
        return {
            leftElement: accountsCountAndApy({
                label: count > 0 ? label : undefined,
                value: interestRatePercentageRounded,
                type: interestRate?.type,
            }),
            description: count > 0 ? label : undefined,
            apy: accountsApy({
                value: interestRatePercentageRounded,
                type: interestRate?.type,
            }),
            count,
        };
    });
}
//# sourceMappingURL=useLeftAccountsApy.js.map