import { jsx as c } from "react/jsx-runtime";
import d from "../../utils/classNames.js";
import m from "../tooltip/SimpleTooltip.js";
const u = (n) => {
  const { id: e, block: o, defaultBackgroundColor: a, hoverEffect: s, blockWidth: i, blockHeight: k } = n, t = !!o.onClick, p = d(
    "tracker-block",
    o.color || a,
    s && "tracker-block-hover",
    t && "cursor-pointer",
    o.className
  ), r = /* @__PURE__ */ c(
    "div",
    {
      className: p,
      onClick: () => o.onClick?.(e),
      onKeyDown: (l) => {
        t && (l.key === "Enter" || l.key === " ") && (l.preventDefault(), o.onClick?.(e));
      },
      role: t ? "button" : void 0,
      tabIndex: t ? 0 : void 0,
      "aria-label": typeof o.tooltip == "string" ? o.tooltip : void 0,
      style: {
        width: `${i}px`,
        minWidth: `${i}px`,
        height: `${k}px`
      }
    }
  );
  return o.tooltip ? /* @__PURE__ */ c(m, { content: o.tooltip, allowOnTouch: !0, placement: "top", delay: { show: 100, hide: 50 }, children: r }) : r;
};
export {
  u as default
};
//# sourceMappingURL=TrackerBlock.js.map
