import React from 'react';
import { Message } from '../message';
import { TruncateWithTooltip } from '../truncate-with-tooltip';
import { FontAwesomeIcon } from '../font-awesome-icon';
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
const DefaultChildren = ({
  name
}) => /*#__PURE__*/_jsx(_Fragment, {
  children: name
});
const FileTreeItemContent = ({
  defaultIcon,
  item,
  children = DefaultChildren,
  disabled = false,
  testId = 'file-tree-tem-content',
  truncateWithTooltip = true
}) => {
  return /*#__PURE__*/_jsxs("div", {
    className: "item-label",
    "test-id": testId,
    children: [defaultIcon && /*#__PURE__*/_jsx(FontAwesomeIcon, {
      icon: defaultIcon,
      className: "item-icon"
    }), /*#__PURE__*/_jsx("p", {
      className: "item-label-children",
      children: /*#__PURE__*/_jsx(TruncateWithTooltip, {
        isDisabled: !truncateWithTooltip,
        children: /*#__PURE__*/_jsx("span", {
          children: children?.(item, disabled)
        })
      })
    }), item?.message && /*#__PURE__*/_jsx(Message, {
      type: item?.message.type,
      children: item?.message?.content
    })]
  });
};
export default FileTreeItemContent;