import {
  ReactionButton_default
} from "./chunk-WPSGU5BR.mjs";

// tmp-babel/comments/web/CommentItem/CommentReactionButton/index.js
import { IconButton } from "@baseapp-frontend/design-system/components/web/buttons";
import { FavoriteIcon, FavoriteSelectedIcon } from "@baseapp-frontend/design-system/components/web/icons";
import { Typography } from "@mui/material";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
var CommentReactionButton = function CommentReactionButton2(_ref) {
  var targetRef = _ref.target;
  return /* @__PURE__ */ _jsx(ReactionButton_default, {
    target: targetRef,
    reactionType: "LIKE",
    children: function children(_ref2) {
      var _target$myReaction, _target$reactionsCoun;
      var handleReaction = _ref2.handleReaction, target = _ref2.target;
      return /* @__PURE__ */ _jsxs("div", {
        className: "grid grid-cols-[repeat(2,minmax(20px,max-content))] gap-1",
        children: [/* @__PURE__ */ _jsx(IconButton, {
          onClick: handleReaction,
          "aria-label": "react to comment ".concat(target.id),
          children: target !== null && target !== void 0 && (_target$myReaction = target.myReaction) !== null && _target$myReaction !== void 0 && _target$myReaction.id ? /* @__PURE__ */ _jsx(FavoriteSelectedIcon, {
            sx: {
              color: "error.main"
            }
          }) : /* @__PURE__ */ _jsx(FavoriteIcon, {})
        }), /* @__PURE__ */ _jsx(Typography, {
          variant: "caption",
          color: "text.secondary",
          "aria-label": "reactions count ".concat(target === null || target === void 0 ? void 0 : target.id),
          children: target === null || target === void 0 || (_target$reactionsCoun = target.reactionsCount) === null || _target$reactionsCoun === void 0 ? void 0 : _target$reactionsCoun.total
        })]
      });
    }
  });
};
var CommentReactionButton_default = CommentReactionButton;

export {
  CommentReactionButton_default
};
//# sourceMappingURL=chunk-7DZJ65CV.mjs.map