import {jsx}from'react/jsx-runtime';import {Fill}from'@common-stack/components-pro';import {LOGO_SLOT_FILL_NAME}from'@admin-layout/tailwind-design-pro/lib/components/Layout/slot-fill/Logo.js';import {useMediaQuery}from'@admin-layout/tailwind-design-pro/lib/hooks/useMediaQuery.js';import {Logo}from'../components/Logo.js';const defaultRenderLogo = (logo, prefersReducedMotion, scrolled, settings, location) => {
  if (typeof logo === 'string') {
    return jsx(Logo, {
      logo: undefined,
      settings: settings,
      scrolled: scrolled,
      location: location
    });
  }
  if (typeof logo === 'function') {
    return logo();
  }
  return logo;
};
const defaultRenderLogoAndTitle = (props, prefersReducedMotion, renderKey = 'menuHeaderRender') => {
  const {
    settings,
    layout,
    pageTitleInfo,
    scrolled,
    location
  } = props;
  const {
    fontFamily,
    titleFontSize,
    titleFontWeight,
    titleHeight,
    titleColor,
    letterSpacing,
    logo,
    title
  } = settings || {};
  const renderFunction = props[renderKey || ''];
  if (renderFunction === false) {
    return null;
  }
  const logoDom = defaultRenderLogo(logo, prefersReducedMotion, scrolled, settings, location);
  const titleDom = jsx("h1", {
    className: `text-2xl ${settings?.navTheme === 'dark' ? 'text-[#F9FBFF]' : titleColor || 'text-gray-900'}`,
    style: {
      fontFamily: fontFamily,
      fontWeight: titleFontWeight,
      height: titleHeight,
      letterSpacing: letterSpacing,
      fontSize: titleFontSize
    },
    children: title
  });
  if (renderFunction) {
    const {
      isMobile
    } = useMediaQuery();
    return renderFunction(logoDom, isMobile ? null : titleDom, props);
  }
  if (layout === 'mix' && renderKey === 'menuHeaderRender') {
    return null;
  }
  return jsx("div", {
    className: "flex space-x-2 w-[200px] md:w-[200px] h-[60px]",
    children: logoDom
  });
};
const LogoFill = () => {
  return jsx(Fill, {
    name: LOGO_SLOT_FILL_NAME,
    children: props => {
      const headerDom = defaultRenderLogoAndTitle({
        scrolled: props?.scrolled,
        ...props
      }, props?.prefersReducedMotion, props?.layout === 'mix' ? 'headerTitleRender' : undefined);
      return headerDom;
    }
  });
};export{LogoFill,defaultRenderLogo,defaultRenderLogoAndTitle};//# sourceMappingURL=LogoFill.js.map
