import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { AviLinkMedium } from "../../../AviLink";
import { useAppState } from "../../../../../../overmind";
import { useCachedUser } from "../../../../../../hooks/useCached";
const MemberRow = ({ 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 (_jsxs("div", { className: "member-row-wrapper", children: [_jsx(AviLinkMedium, { showVerified: true, wrapperClass: "avi", username: user, userObj: userObj }), _jsxs("p", { className: "member-row-p", children: [amtLocked || 0, " $", ticker] })] }));
};
export default MemberRow;
//# sourceMappingURL=MemberRow.js.map