import React from 'react';
import { DEFAULT_LOGO_DASHBOARD, DEFAULT_LOGO_LOGIN, DF_HEADER_BG_COLOR, DF_MENU_BG_ACTIVE_COLOR, DF_MENU_BG_COLOR, DF_MENU_HOVER_BG_COLOR, DF_MENU_ICON_ACTICE_COLOR, DF_MENU_ICON_AND_TEXT_HOVER_COLOR, DF_MENU_ICON_COLOR, DF_MENU_ICON_HOVER_COLOR, DF_MENU_TEXT_COLOR, DF_SEARCH_BG_COLOR, DF_SEARCH_BORDER_COLOR, DF_SEARCH_BORDER_HOVER_COLOR, DF_SEARCH_ICON_COLOR, DF_SEARCH_TEXT_COLOR, DF_SKELETON_COLOR, } from '../../../utils/constants';
const defaultSettingLayout = {
    header_bg_color: DF_HEADER_BG_COLOR,
    logo_login: DEFAULT_LOGO_LOGIN,
    logo_dashboard: DEFAULT_LOGO_DASHBOARD,
    color_loading_skeleton: DF_SKELETON_COLOR,
    search_icon_color: DF_SEARCH_ICON_COLOR,
    search_bg_color: DF_SEARCH_BG_COLOR,
    search_border_color: DF_SEARCH_BORDER_COLOR,
    search_border_hover_color: DF_SEARCH_BORDER_HOVER_COLOR,
    search_text_color: DF_SEARCH_TEXT_COLOR,
    menu_bg_color: DF_MENU_BG_COLOR,
    menu_text_color: DF_MENU_TEXT_COLOR,
    menu_bg_active: DF_MENU_BG_ACTIVE_COLOR,
    menu_icon_color: DF_MENU_ICON_COLOR,
    menu_icon_hover: DF_MENU_ICON_HOVER_COLOR,
    menu_text_and_icon_hover_color: DF_MENU_ICON_AND_TEXT_HOVER_COLOR,
    menu_icon_active: DF_MENU_ICON_ACTICE_COLOR,
    menu_hover_bg: DF_MENU_HOVER_BG_COLOR,
};
const StyledCustomLayout = (props) => {
    const { configLayout, settingSiteCookie } = props;
    const handleCheckLayoutSetting = (settingKey) => (configLayout === null || configLayout === void 0 ? void 0 : configLayout[settingKey]) || (settingSiteCookie === null || settingSiteCookie === void 0 ? void 0 : settingSiteCookie[settingKey]) || (defaultSettingLayout === null || defaultSettingLayout === void 0 ? void 0 : defaultSettingLayout[settingKey]);
    const hexColorPattern = /#[0-9A-Fa-f]{6}/g;
    const containsHexColor = hexColorPattern.test(handleCheckLayoutSetting('header_bg_color'));
    const styledHeader = containsHexColor
        ? `background: ${handleCheckLayoutSetting('header_bg_color')}`
        : `background-color: ${handleCheckLayoutSetting('header_bg_color')}`;
    const checkGradientSearchBox = hexColorPattern.test(handleCheckLayoutSetting('search_bg_color'));
    const styleSearchBox = checkGradientSearchBox
        ? `background: ${handleCheckLayoutSetting('search_bg_color')}`
        : `background-color:${handleCheckLayoutSetting('search_bg_color')}`;
    return (React.createElement("style", null, `
      /* styled header */
        .header-loading-logo {
          background-color: ${handleCheckLayoutSetting('header_bg_color')}
        }

        .header-loading-avatar {
          background-color: ${handleCheckLayoutSetting('color_loading_skeleton')}
        }

        .header-styled {
         ${styledHeader}
        }

        .header-color-styled{
          border-color: ${handleCheckLayoutSetting('header_bg_color')}
        }

        /* styled search box */
        .search-box-styled {
         ${styleSearchBox};
          border-color: ${handleCheckLayoutSetting('search_border_color')}
        }

        /* màu border trong search box khi hover */
        .search-box-styled:hover {
          border-color: ${handleCheckLayoutSetting('search_border_hover_color')}
        }

        /* màu chữ trong search box */
        .search-text-styled {
          color: ${handleCheckLayoutSetting('search_text_colo')}
        }

        /* màu icon trong search box */
        .search-icon-styled {
          color: ${handleCheckLayoutSetting('search_icon_color')}
        }
        /*  end styled search box */

        /* styled left menu */
        /* màu background */
        .menu-styled {
          background-color: ${handleCheckLayoutSetting('menu_bg_color')};
          border-color: ${handleCheckLayoutSetting('menu_bg_color')}
        }
        /* màu icon */
        .menu-icon-color-styled {
          color: ${handleCheckLayoutSetting('menu_icon_color')}
        }
        .menu-icon-color-styled:hover {
          color: ${handleCheckLayoutSetting('menu_text_and_icon_hover_color')}
        }

        /* màu background icon đang được active */
        .menu-bg-color-icon-active-styled {
          background-color: ${handleCheckLayoutSetting('menu_bg_active')};
          color: ${handleCheckLayoutSetting('menu_icon_active')}
        }
       
       /* màu background khi hover */
       .menu-hover-bg:hover {
        background-color: ${handleCheckLayoutSetting('menu_hover_bg')}
       }

      /* màu chữ */
      .menu-text-color-styled {
        color : ${handleCheckLayoutSetting('menu_text_color')}
      }


      /* màu icon setting */
      .setting-icon-color {
        color: ${handleCheckLayoutSetting('menu_icon_color')}
      }

      /* màu chữ setting */
      .setting-text-color {
        color : ${handleCheckLayoutSetting('menu_text_color')}
      }

      /* màu background active setting */
      .setting-bg-icon-active {
        background-color: ${handleCheckLayoutSetting('menu_bg_active')};
        color: ${handleCheckLayoutSetting('menu_icon_active')}
      }

      /* màu background setting hover */
      .setting-hover-bg:hover {
       background-color: ${handleCheckLayoutSetting('menu_hover_bg')}
      }
       /* end styled menu */
        `));
};
export default StyledCustomLayout;
//# sourceMappingURL=appearance-styled.js.map