mediahub-fe/components/partials/header/header-logo.tsx

33 lines
1.1 KiB
TypeScript
Raw Normal View History

2024-11-28 17:23:53 +00:00
"use client";
import React from "react";
import { Link } from "@/components/navigation";
import DashCodeLogo from "@/components/dascode-logo";
import { useConfig } from "@/hooks/use-config";
import { useMediaQuery } from "@/hooks/use-media-query";
2024-11-26 03:09:48 +00:00
const HeaderLogo = () => {
2024-11-28 17:23:53 +00:00
const [config] = useConfig();
2024-11-26 03:09:48 +00:00
2024-11-28 17:23:53 +00:00
const isDesktop = useMediaQuery("(min-width: 1280px)");
2024-11-26 03:09:48 +00:00
2024-11-28 17:23:53 +00:00
return config.layout === "horizontal" ? (
<Link href="/dashboard/analytics" className="flex gap-2 items-center ">
<DashCodeLogo className=" text-default-900 h-8 w-8 [&>path:nth-child(3)]:text-background [&>path:nth-child(2)]:text-background" />
<h1 className="text-xl font-semibold text-default-900 lg:block hidden ">
DashCode
</h1>
</Link>
) : (
!isDesktop && (
<Link href="/dashboard/analytics" className="flex gap-2 items-center ">
<DashCodeLogo className=" text-default-900 h-8 w-8 [&>path:nth-child(3)]:text-background [&>path:nth-child(2)]:text-background" />
<h1 className="text-xl font-semibold text-default-900 lg:block hidden ">
DashCode
</h1>
</Link>
2024-11-26 03:09:48 +00:00
)
2024-11-28 17:23:53 +00:00
);
};
2024-11-26 03:09:48 +00:00
2024-11-28 17:23:53 +00:00
export default HeaderLogo;