import { jsx as _jsx } from "react/jsx-runtime";
import { AviLinkMedium } from "../../../AviLink";
import { Link } from "react-router-dom";
import { useAppState } from "../../../../../../overmind";
import { useCachedUser } from "../../../../../../hooks/useCached";
export const MemberCard = ({ user, daoId, ticker }) => {
    const state = useAppState();
    const userObj = useCachedUser({ username: user });
    let votes = state.newcoin.cache.votes[user]?.rows;
    let amtLocked;
    if (votes?.length) {
        let quantities = votes && votes?.filter((row) => row.dao_id == daoId).map((vote) => vote.quantity?.quantity);
        if (quantities?.length) {
            let amtsLocked = quantities && quantities?.map((qt) => Number(qt?.split(" ")[0]));
            if (amtsLocked?.length) {
                amtLocked = amtsLocked?.reduce((a, b) => a + b);
            }
        }
    }
    return (_jsx(Link, { className: "", to: `/user/${user}`, children: _jsx("div", { className: "member-card-ctn", children: _jsx(AviLinkMedium, { showVerified: true, wrapperClass: "avi", username: user, userObj: userObj }) }) }));
};
//# sourceMappingURL=MemberCard.js.map