mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 16:56:22 +02:00
34 lines
917 B
TypeScript
34 lines
917 B
TypeScript
|
|
"use client";
|
||
|
|
|
||
|
|
import { usePathname } from "next/navigation";
|
||
|
|
import { navConfig } from "@/lib/config";
|
||
|
|
import { ModeToggle } from "@/components/theme/mode-toggle";
|
||
|
|
import { SidebarMobile } from "../../layout-components";
|
||
|
|
|
||
|
|
const Header = () => {
|
||
|
|
const pathName = usePathname();
|
||
|
|
const pageTitle = navConfig.navLinks.find((elem) => {
|
||
|
|
if (elem.href === pathName) {
|
||
|
|
return elem.pageTitle;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
return (
|
||
|
|
<div className="flex h-full w-full flex-row items-center justify-between text-foreground">
|
||
|
|
<div className="block w-full font-medium sm:block">
|
||
|
|
{pageTitle?.pageTitle}
|
||
|
|
</div>
|
||
|
|
<div className="flex h-full w-full items-center justify-end gap-4">
|
||
|
|
<div className="block sm:hidden">
|
||
|
|
<SidebarMobile />
|
||
|
|
</div>
|
||
|
|
<div className="hidden sm:block">
|
||
|
|
<ModeToggle />
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
);
|
||
|
|
};
|
||
|
|
|
||
|
|
export default Header;
|