import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
import { AviLinkMedium, AviLinkRegular } from "../../../AviLink";
import { Button } from "antd";
import { Link } from "react-router-dom";
import { VoteBar } from "../../../VoteBar";
import { getLocalTimeData } from "../../../../Utils/Helpers";
import { useAppState } from "../../../../../../overmind";
import { useCachedDaoWhitelistProposal, useCachedUser } from "../../../../../../hooks/useCached";
export const WhitelistProposalRow = (props) => {
    const state = useAppState();
    const daoOwner = props.daoOwner || state.config.settings.newcoin.daoDomain;
    const proposalId = props.proposal.id;
    const proposal = useCachedDaoWhitelistProposal({
        daoOwner,
        proposalId: props?.proposal?.id,
    });
    const proposer = proposal.proposer;
    const proposerObj = useCachedUser({ username: proposer });
    const newMember = useCachedUser({ username: proposal.user });
    const timeData = getLocalTimeData(proposal);
    return (_jsx("div", { className: "std-row-wrapper", children: _jsxs(Link, { to: `/dao/${props.daoOwner}/member-proposal/${proposalId}`, children: [_jsxs("div", { className: "std-row-wl-top", children: [_jsxs("div", { className: "title-hands-ctn", children: [_jsxs("p", { className: "wl-id", children: ["#", proposal.id] }), _jsx(AviLinkMedium, { showVerified: true, wrapperClass: "avi", username: newMember.username, userObj: newMember })] }), _jsx(Button, { className: "view-btn", href: `/dao/${daoOwner}/proposal/${proposal.id}`, children: "View" })] }), _jsxs("div", { className: "std-row-mid", children: [_jsx(VoteBar, { timeData: timeData, proposal: proposal }), _jsx(AviLinkRegular, { showVerified: true, wrapperClass: "avi", username: proposer, userObj: proposerObj })] })] }) }));
};
//# sourceMappingURL=WhitelistProposalRow.js.map