'use strict';
import { jsxs, jsx } from 'react/jsx-runtime';
import { SubHeading } from '../../../fd-component-toolbox/subheading/SubHeading.js';
import { ViewSheet } from '../../view/ViewSheet.js';
import { TableHeaderActionButton } from '../../table/header-cell/TableHeaderCellActionButton.js';
import { isResourceListSubHeadingVisible, isHeaderAddActionVisible } from './ResourceListHeader.funcs.js';

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", {
  value,
  configurable: true
});
function ResourceListHeader({
  resourceName,
  uiResourceMeta,
  resourceListEmpty,
  tableRequired,
  pluralName,
  onRefreshResources
}) {
  return isResourceListSubHeadingVisible(tableRequired, pluralName) && /* @__PURE__ */jsxs("div", {
    className: "group flex items-center gap-2",
    children: [/* @__PURE__ */jsx(SubHeading, {
      className: "mt-1",
      children: pluralName
    }), isHeaderAddActionVisible(resourceListEmpty, tableRequired, pluralName) && /* @__PURE__ */jsx("div", {
      className: "animate-fade-out group-hover:animate-fade-in",
      children: /* @__PURE__ */jsx(ViewSheet, {
        resourceName,
        uiResourceMeta,
        onRefreshItems: onRefreshResources,
        children: /* @__PURE__ */jsx(TableHeaderActionButton, {})
      })
    })]
  });
}
__name(ResourceListHeader, "ResourceListHeader");

export { ResourceListHeader };
