import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
import { Link } from "react-router-dom";
import { Avatar, Col, Row } from "antd";
import { Hands, ProgressBar } from "./Icons";
import { ContentImage } from "../../../Components/Image";
import { useCachedUser } from "../../../hooks/useCached";
import { getLocalTimeData } from "../Utils/Helpers";
export const ProposalCard = (props) => {
    const timeData = getLocalTimeData(props.proposal);
    const proposerObj = useCachedUser({ username: props.proposal.proposer });
    return _jsx(Link, { to: `/dao/${props.daoOwner}/proposal/${props.proposal.id}`, children: _jsxs(Col, { className: "proposal-list-card-wrapper", children: [_jsx(Row, { className: "u-dao-card-top-details-wrapper", align: "middle", justify: "space-between", children: _jsxs(Row, { className: "u-dao-card-top-details-left", align: "middle", children: [_jsxs("p", { className: "proposal-list-id-p", children: ["#", props.proposal.id] }), _jsx("span", { className: "proposal-list-hands-icon-span", children: _jsx(Hands, {}) }), _jsx("p", { className: "proposal-list-title-p", children: props.proposal.title })] }) }), _jsxs(Col, { className: "u-dao-card-mid-details-wrapper", children: [_jsxs("p", { className: "paragraph-2b", children: ["YES votes: ", (props.proposal.vote_yes?.quantity)] }), _jsxs("p", { className: "paragraph-2b", children: ["NO votes: ", (props.proposal.vote_no?.quantity), " "] }), _jsx(ProgressBar, { width: "350px", proposal: props.proposal }), _jsxs("p", { className: "proposal-list-time-left-p", children: ["Ending in: ", timeData.time_left_seconds, "  "] })] }), _jsxs("p", { className: "proposal-list-summary-p", children: [" ", props.proposal.summary] }), _jsx("p", { className: "proposal-list-props.proposal-by-p", children: "proposal by" }), _jsxs(Row, { className: "u-dao-card-btm-details-wrapper", children: [_jsx(Col, { className: "proposal-list-card-btm-user-details-left-ctn", children: _jsxs(Link, { className: "proposal-list-props.proposal-avi-link", to: `/user/${props.proposal.proposer}`, children: [" ", _jsx(Avatar, { src: _jsx(ContentImage, { ...proposerObj }), className: "proposal-list-props.proposal-avi-cmpt" })] }) }), _jsxs(Col, { className: "proposal-list-card-btm-user-details-right-ctn", children: [_jsx("p", { className: "proposal-list-card-btm-user-display-name-p", children: props.proposal.proposer }), _jsx("p", { className: "view-proposal-user-full-name-p", children: proposerObj.fullName })] })] })] }) });
};
//# sourceMappingURL=ProposalCard.js.map