@lobehub/ui
Version:
Lobe UI is an open-source UI component library for building AIGC web apps
35 lines (34 loc) • 1.13 kB
JavaScript
"use client";
import { useConsoleShellState } from "./context.mjs";
import { styles } from "./style.mjs";
import { jsx, jsxs } from "react/jsx-runtime";
//#region src/dashboard/ConsoleShell/ConsoleBrand.tsx
function ConsoleBrand({ href = "/", label, logo, renderLink, title }) {
const shell = useConsoleShellState();
const content = title == null || title === false || title === "" ? logo : /* @__PURE__ */ jsxs("span", {
className: styles.brandLockup,
children: [logo, /* @__PURE__ */ jsx("span", {
className: styles.brandName,
children: title
})]
});
const linkProps = {
"aria-label": label ?? (typeof title === "string" ? title : "Home"),
"children": content,
"className": styles.brandAnchor,
href,
"onClick": () => shell?.closeNavigation()
};
if (renderLink) return renderLink(linkProps);
return /* @__PURE__ */ jsx("a", {
"aria-label": linkProps["aria-label"],
className: linkProps.className,
href,
onClick: linkProps.onClick,
children: content
});
}
ConsoleBrand.displayName = "ConsoleBrand";
//#endregion
export { ConsoleBrand as default };
//# sourceMappingURL=ConsoleBrand.mjs.map