function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
import { useMemo } from "react";
import useColor from "../../../hooks/useColor";
var border = function border(_ref) {
  var borderSideColor = _ref.borderSideColor,
    borderTopColor = _ref.borderTopColor,
    showBorderLeft = _ref.showBorderLeft;
  return _objectSpread({
    borderRight: "1px solid " + borderSideColor,
    borderTop: "2px solid " + borderTopColor
  }, showBorderLeft ? {
    borderLeft: "1px solid " + borderSideColor
  } : {});
};
var useStyleTabs = function useStyleTabs(_ref2) {
  var _ref2$active = _ref2.active,
    active = _ref2$active === void 0 ? false : _ref2$active,
    _ref2$showBorderLeft = _ref2.showBorderLeft,
    showBorderLeft = _ref2$showBorderLeft === void 0 ? false : _ref2$showBorderLeft,
    isDragOverlay = _ref2.isDragOverlay;
  var pickColor = useColor();
  var borderSideColor = pickColor("border");
  var borderTopColor = active ? pickColor("primary") : "transparent";
  var rootStyles = useMemo(function () {
    return {
      cursor: "pointer",
      gap: 1,
      alignItems: "center",
      justifyContent: "start",
      position: "relative",
      padding: [1, 2],
      background: active ? "mainBackground" : "topBarBg",
      height: 8,
      sx: _objectSpread(_objectSpread({}, border({
        borderSideColor: borderSideColor,
        borderTopColor: borderTopColor,
        showBorderLeft: showBorderLeft
      })), isDragOverlay && {
        boxShadow: "0 2px 6px rgba(0, 0, 0, 0.15)"
      })
    };
  }, [borderTopColor, borderSideColor, active]);
  return {
    rootStyles: rootStyles
  };
};
export default useStyleTabs;