import { __rest } from "tslib";
import { jsx as _jsx } from "react/jsx-runtime";
import { Link, SCPreferences, SCRoutes, useSCPreferences, useSCRouting } from '@selfcommunity/react-core';
import { useMemo } from 'react';
import { styled } from '@mui/material/styles';
import { Box } from '@mui/material';
import classNames from 'classnames';
import { useThemeProps } from '@mui/system';
const PREFIX = 'SCDefaultHeaderContent';
const classes = {
    root: `${PREFIX}-root`
};
const Root = styled(Box, {
    name: PREFIX,
    slot: 'Root',
    overridesResolver: (_, styles) => styles.root
})(() => ({}));
export default function DefaultHeaderContent(inProps) {
    const props = useThemeProps({
        props: inProps,
        name: PREFIX
    });
    const { className } = props, rest = __rest(props, ["className"]);
    const scRoutingContext = useSCRouting();
    // PREFERENCES
    const scPreferences = useSCPreferences();
    const _logo = useMemo(() => {
        return SCPreferences.LOGO_NAVBAR_LOGO in scPreferences.preferences ? scPreferences.preferences[SCPreferences.LOGO_NAVBAR_LOGO].value : null;
    }, [scPreferences.preferences]);
    return (_jsx(Root, Object.assign({ className: classNames(className, classes.root) }, rest, { children: _jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.HOME_ROUTE_NAME, {}) }, { children: _jsx("img", { src: _logo, alt: "logo" }) })) })));
}
