import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { ApproveModal } from "./Modals/ApproveModal";
import { Button } from "antd";
import { ExecuteModal } from "./Modals/ExecuteModal";
import { GetWhitelistedModal } from "./Modals/GetWhitelistedModal";
import { Link } from "react-router-dom";
import { StakeModal } from "./Modals/StakeModal";
import { VoteModal } from "./Modals/VoteModal";
import { WithdrawForm } from "./Modals/WithdrawModal";
import { useGetAuthorizedActions } from "../Utils/Helpers";
export const ModalCtrl = ({ proposal, daoOwner, proposal_type, currUser, proposalId }) => {
    const { status_tag, action_type, vote, timeData } = useGetAuthorizedActions({
        daoOwner,
        proposalId,
        currUser,
        proposal_type,
        proposal,
    });
    return (_jsxs("div", { children: [action_type == "Approve" && _jsx(ApproveModal, { proposal_type: proposal_type, dao_owner: daoOwner, proposal_id: proposal.id }), _jsx(VoteModal, { proposal_type: proposal_type, daoOwner: daoOwner, proposal: proposal, proposalId: proposal.id, visible: action_type == "Vote" }), ["Withdraw", "Execute"].includes(action_type) && vote?.id && (_jsx(WithdrawForm, { vote_id: vote?.id, quantity: vote?.quantity?.quantity })), action_type == "Execute" && (_jsx(ExecuteModal, { dao_owner: daoOwner, proposal_type: proposal_type, dao_id: proposal.id, proposal_id: proposal.id, proposal_author: proposal.proposer })), action_type == "GetWhitelisted" && _jsx(GetWhitelistedModal, { daoOwner: daoOwner }), action_type == "GetWhitelisted" && (_jsx(Link, { to: `/dao/${daoOwner}/proposals`, children: _jsx(Button, { className: "power-up-btn", children: "Get Whitelisted" }) })), action_type == "Voted" && _jsxs(Button, { className: "power-up-btn", children: ["You Voted ", vote?.quantity?.quantity] }), action_type == "View" && _jsx(Button, { className: "power-up-btn", children: "View" }), _jsx(StakeModal, { visible: action_type == "Stake", daoOwner: daoOwner })] }));
};
//# sourceMappingURL=ModalCtrl.js.map