import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
import { AviLinkRegular } from "../../../AviLink";
import { Col, Row } from "antd";
import { Link } from "react-router-dom";
import { VoteBarFull } from "../../../VoteBar";
import { getLocalTimeData } from "../../../../Utils/Helpers";
import { useCachedUser } from "../../../../../../hooks/useCached";
export const ProposalCard = (props) => {
    const timeData = getLocalTimeData(props.proposal);
    const proposerObj = useCachedUser({ username: props.proposal.proposer });
    const proposalSummaryArr = props.proposal.summary?.split("#");
    const proposalSummary = proposalSummaryArr ? proposalSummaryArr[0] : "";
    let proposalType = proposalSummaryArr && proposalSummaryArr[1];
    proposalType = proposalType == "undefined" ? "feature" : proposalType;
    return (_jsx(Link, { to: `/dao/${props.daoOwner}/proposal/${props.proposal.id}`, children: _jsxs(Col, { className: "card-wrapper", children: [_jsxs(Row, { className: "card-top", justify: "space-between", children: [_jsxs(Row, { align: "middle", children: [_jsxs("p", { className: "header-5 u-margin-right-small", children: ["#", props.proposal.id] }), _jsx("p", { className: "card-title header-5", children: props.proposal.title })] }), _jsx(Row, { align: "middle", children: _jsxs("p", { className: "", children: ["#", proposalType] }) })] }), _jsx(VoteBarFull, { proposal: props.proposal, timeData: timeData }), _jsxs("p", { className: "card-summary u-dao-header-2r u-margin-top-15", children: [" ", proposalSummary] }), _jsxs(Row, { className: "u-margin-top-medium", align: "middle", justify: "space-between", children: [_jsx("p", { className: "", children: "proposal by" }), _jsx(AviLinkRegular, { showVerified: true, wrapperClass: "avi", username: proposerObj.username, userObj: proposerObj })] })] }) }));
};
//# sourceMappingURL=ProposalCard.js.map