"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useAvatars = useAvatars;
const react_1 = require("react");
const profile_cache_1 = require("../context/profile-cache");
function useAvatars(dids) {
    const { profiles, requestProfiles } = (0, profile_cache_1.useProfileCache)();
    (0, react_1.useEffect)(() => {
        requestProfiles(dids);
    }, [dids, requestProfiles]);
    return (0, react_1.useMemo)(() => Object.fromEntries(dids.filter((d) => d in profiles).map((d) => [d, profiles[d]])), [dids, profiles]);
}
//# sourceMappingURL=useAvatars.js.map