import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
import { AviLinkRegular } from "../../../AviLink";
import { Button } from "antd";
import { Link } from "react-router-dom";
import { VoteBar } from "../../../VoteBar";
import { defaultDao } from "../../../../Utils/defaultDao";
import { getLocalTimeData } from "../../../../Utils/Helpers";
import { useAppState } from "../../../../../../overmind";
import { useCachedDaoProposal, useCachedUser } from "../../../../../../hooks/useCached";
export const ProposalRow = (props) => {
    const state = useAppState();
    const currUser = state.api.auth.user?.username || "";
    const daoOwner = props.daoOwner || defaultDao(state); //state.config.settings.newcoin.daoDomain;
    const proposalId = props.proposal.id;
    const proposal = useCachedDaoProposal({
        daoOwner,
        proposalId: props?.proposal?.id,
    });
    const proposer = proposal.proposer;
    const proposerObj = useCachedUser({ username: proposer });
    const proposal_type = "standart";
    const timeData = getLocalTimeData(proposal);
    return (_jsx("div", { className: "std-row-wrapper", children: _jsxs(Link, { to: `/dao/${props.daoOwner}/proposal/${proposal.id}`, children: [_jsxs("div", { className: "std-row-top", children: [_jsxs("div", { className: "title-hands-ctn", children: [_jsxs("p", { className: "id", children: ["#", proposal.id] }), _jsx("p", { className: "title", children: proposal.title })] }), _jsx(Button, { 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: proposal.proposer, userObj: proposerObj })] })] }) }));
};
//# sourceMappingURL=ProposalRow.js.map