import { jsxs as o, jsx as e } from "react/jsx-runtime";
import { Classes as d } from "../../constants/selectors.js";
import { cn as s } from "../../utils/cn.js";
import { Icon as m } from "../icon/icon.js";
const x = ({
  filename: t,
  icon: r,
  codeBlockTheme: a = "system",
  children: n
}) => /* @__PURE__ */ o(
  "div",
  {
    className: "flex rounded-t-[14px] py-1 pr-2.5 pl-4 font-medium text-stone-400 text-xs leading-6",
    "data-component-part": "code-block-header",
    children: [
      /* @__PURE__ */ o(
        "div",
        {
          className: s(
            "flex min-w-0 grow-0 items-center gap-1.5 text-stone-700 dark:text-stone-300",
            a === "dark" && "text-stone-300"
          ),
          "data-component-part": "code-block-header-filename",
          children: [
            r && /* @__PURE__ */ e(
              m,
              {
                className: s(
                  "size-3.5 shrink-0 bg-stone-500 dark:bg-stone-400",
                  d.CodeBlockIcon
                ),
                icon: r,
                iconType: "regular",
                overrideColor: !0
              }
            ),
            !!t && /* @__PURE__ */ e("span", { className: "mr-2 min-w-0 truncate", children: t })
          ]
        }
      ),
      /* @__PURE__ */ e("div", { className: "flex flex-1 items-center justify-end gap-1.5", children: n })
    ]
  }
);
export {
  x as CodeHeader
};
