import { jsx as _jsx } from "react/jsx-runtime";
import { Button } from "antd";
import { useAppState } from "../overmind";
import { useState } from "react";
export const WhitelistPreview = ({ setActiveTags, activeTags, user }) => {
    const [activeButton, setActiveButton] = useState(false);
    const state = useAppState();
    const items = state.lists.search.posts.results?.value || [];
    const buttonClassName = activeButton ? "primary-green-btn" : "secondary-button";
    return (_jsx("div", { className: "new-proposal-whitelist-ctn", children: _jsx(Button, { onClick: () => {
                if (activeTags.includes(user)) {
                    const arr = [...activeTags];
                    const index = arr.indexOf(user);
                    index !== -1 && arr.splice(index, 1);
                    setActiveTags(arr);
                }
                else {
                    setActiveTags((p) => [...p, user]);
                }
                setActiveButton(!activeButton);
            }, className: `${buttonClassName} u-margin-bottom-medium u-margin-top-medium`, style: { border: "none" }, children: _jsx("span", { className: activeButton ? "paragraph-2r" : "paragraph-2u", children: user }) }) }));
};
//# sourceMappingURL=WhitelistPreview.js.map