import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { Avatar, Col, Row } from "antd";
import { Link, useParams } from "react-router-dom";
import { ContentImage } from "../../Components/Image";
import { useCachedDaoWhitelist, useCachedUser } from "../../hooks/useCached";
const Whitelist = () => {
    const { daoOwner } = useParams();
    const whitelistMembers = useCachedDaoWhitelist({ daoOwner });
    const WhiteListRow = ({ user }) => {
        const userObj = useCachedUser({ username: user });
        return _jsxs(Row, { justify: "space-around", align: "middle", className: "whitelist-row", children: [_jsxs("div", { className: "whitelist-row-user-details", children: [_jsxs(Link, { className: "proposal-list-proposal-avi-link", to: `/user/${user}`, children: [" ", _jsx(Avatar, { src: _jsx(ContentImage, { ...userObj }), className: "proposal-list-proposal-avi-cmpt" })] }), _jsx("p", { className: "header-1r", children: user || "Creator.io" }), _jsx("p", { className: "paragraph-1r", children: userObj.fullName })] }), _jsx(Row, { className: "whitelist-row-right-ctn", align: "middle", children: _jsxs("p", { className: "whitelist-row-votes-p", children: ["powered: ", userObj.powered, "k"] }) })] });
    };
    return _jsxs(Col, { children: [_jsxs("p", { className: "header-2 u-margin-bottom-medium", children: [daoOwner, " DAO Members"] }), whitelistMembers.rows?.map((member, idx) => _jsx(WhiteListRow, { user: member.user })), !whitelistMembers.rows?.length &&
                _jsx(_Fragment, { children: "No members" })] });
};
export default Whitelist;
//# sourceMappingURL=Whitelist.js.map