import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
import { Tooltip } from "antd";
import { useBadges } from "../hooks/useBadges";
export const badgeIcons = {
    ["daoVotedProposal"]: 1,
    ["daoCreated"]: 2,
    ["daoCreatedProposal"]: 3,
    ["daoJoinedCount"]: 4,
    ["staked"]: 5,
};
const BadgeWidget = ({ user, className }) => {
    const { badges, isBadgesLoading, badgesError } = useBadges(user?.id || "");
    return (_jsx(_Fragment, { children: badges &&
            !isBadgesLoading &&
            !badgesError &&
            badges.map((badge, index) => {
                return (_jsx(Tooltip, { trigger: "hover", title: badge?.title, children: _jsx("img", { src: `/badges/${badgeIcons[badge.name]}.png`, className: `nl-badge-widget ${index === 0 ? "u-margin-left-small" : ""} u-margin-right-small ${className}` }) }, badge?.id));
            }) }));
};
export default BadgeWidget;
//# sourceMappingURL=BadgeWidget.js.map