"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _message = require("../message");
var _truncateWithTooltip = require("../truncate-with-tooltip");
var _fontAwesomeIcon = require("../font-awesome-icon");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const DefaultChildren = ({
  name
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
  children: name
});
const FileTreeItemContent = ({
  defaultIcon,
  item,
  children = DefaultChildren,
  disabled = false,
  testId = 'file-tree-tem-content',
  truncateWithTooltip = true
}) => {
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
    className: "item-label",
    "test-id": testId,
    children: [defaultIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_fontAwesomeIcon.FontAwesomeIcon, {
      icon: defaultIcon,
      className: "item-icon"
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
      className: "item-label-children",
      children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_truncateWithTooltip.TruncateWithTooltip, {
        isDisabled: !truncateWithTooltip,
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
          children: children?.(item, disabled)
        })
      })
    }), item?.message && /*#__PURE__*/(0, _jsxRuntime.jsx)(_message.Message, {
      type: item?.message.type,
      children: item?.message?.content
    })]
  });
};
var _default = exports.default = FileTreeItemContent;