import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
import { Avatar, Col, Row } from "antd";
import { ContentImage } from "../../../../../../Components/Image";
import { ProgressBar } from "../../../Icons";
import { Link } from "react-router-dom";
import { VerifiedIcon } from "../../../../../../Components/Icons/VerifiedIcon";
import { getLocalTimeData } from "../../../../Utils/Helpers";
import { useCachedUser } from "../../../../../../hooks/useCached";
import { useVerified } from "src/hooks/useVerified";
export const WhitelistCard = (props) => {
    const timeData = getLocalTimeData(props.proposal);
    const proposerObj = useCachedUser({ username: props.proposal.proposer });
    const { verifiedUsers } = useVerified([props.proposal.proposer || ""]);
    const isUserVerified = verifiedUsers && props.proposal.proposer && verifiedUsers.includes(props.proposal.proposer);
    const yesVotes = Number(props.proposal.vote_yes?.quantity?.split(" ")[0]);
    const noVotes = Number(props.proposal.vote_no?.quantity?.split(" ")[0]);
    let proposalType = "new member";
    const newMember = useCachedUser({ username: props.proposal.user });
    return (_jsx(Link, { to: `/dao/${props.daoOwner}/proposal/${props.proposal.id}`, children: _jsxs(Col, { className: "wl-card-wrapper", children: [_jsxs("div", { className: "card-top", children: [_jsx(Row, { align: "middle", children: _jsxs("p", { className: "header-5 u-margin-right-medium", children: ["#", props.proposal.id] }) }), _jsx(Row, { align: "middle", children: _jsxs("p", { className: "", children: ["#", proposalType] }) })] }), _jsxs(Link, { to: `/user/${props.proposal.user}`, className: "u-margin-top-medium wlst-member-details", children: [_jsx(Avatar, { src: _jsx(ContentImage, { ...newMember }), className: "wlst-member-avi" }), _jsxs("p", { className: "wlst-member-username", children: [" ", props.proposal.user] })] }), _jsxs("p", { className: "u-margin-top-15", children: [timeData.time_left_seconds > 0 ? "Ending" : "Ended", " ", timeData.time_left_from_now, " "] }), _jsxs("p", { className: "paragraph-1b u-margin-top-30", children: [" ", yesVotes + noVotes, " votes "] }), _jsx(ProgressBar, { width: "100%", proposal: props.proposal }), _jsxs(Row, { align: "bottom", justify: "space-between", children: [_jsxs("p", { className: "", children: [" ", yesVotes, " yes votes "] }), _jsxs("p", { className: "", children: [" ", noVotes, " no votes "] })] }), _jsxs(Row, { className: "u-margin-top-medium", align: "middle", justify: "space-between", children: [_jsx("p", { className: "", children: "proposal by" }), _jsxs(Link, { className: "", to: `/user/${props.proposal.proposer}`, children: [" ", _jsx(Avatar, { src: _jsx(ContentImage, { ...proposerObj }), className: "proposal-list-props.proposal-avi-cmpt" })] }), _jsx("p", { className: "", children: props.proposal.proposer }), isUserVerified && _jsx(VerifiedIcon, {}), _jsx("p", { className: "", children: proposerObj.fullName })] })] }) }));
};
//# sourceMappingURL=WhitelistCard.js.map