"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const react_core_1 = require("@selfcommunity/react-core");
const react_1 = require("react");
const styles_1 = require("@mui/material/styles");
const material_1 = require("@mui/material");
const classnames_1 = tslib_1.__importDefault(require("classnames"));
const system_1 = require("@mui/system");
const PREFIX = 'SCDefaultHeaderContent';
const classes = {
    root: `${PREFIX}-root`
};
const Root = (0, styles_1.styled)(material_1.Box, {
    name: PREFIX,
    slot: 'Root',
    overridesResolver: (_, styles) => styles.root
})(() => ({}));
function DefaultHeaderContent(inProps) {
    const props = (0, system_1.useThemeProps)({
        props: inProps,
        name: PREFIX
    });
    const { className } = props, rest = tslib_1.__rest(props, ["className"]);
    const scRoutingContext = (0, react_core_1.useSCRouting)();
    // PREFERENCES
    const scPreferences = (0, react_core_1.useSCPreferences)();
    const _logo = (0, react_1.useMemo)(() => {
        return react_core_1.SCPreferences.LOGO_NAVBAR_LOGO in scPreferences.preferences ? scPreferences.preferences[react_core_1.SCPreferences.LOGO_NAVBAR_LOGO].value : null;
    }, [scPreferences.preferences]);
    return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(className, classes.root) }, rest, { children: (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.HOME_ROUTE_NAME, {}) }, { children: (0, jsx_runtime_1.jsx)("img", { src: _logo, alt: "logo" }) })) })));
}
exports.default = DefaultHeaderContent;
