mediahub-fe/components/logo.tsx

39 lines
1.3 KiB
TypeScript
Raw Normal View History

2024-11-28 17:23:53 +00:00
"use client";
2024-11-26 03:09:48 +00:00
import React from "react";
import DashCodeLogo from "./dascode-logo";
2024-11-28 17:23:53 +00:00
import { Link } from "@/i18n/routing";
2024-11-26 03:09:48 +00:00
import { useConfig } from "@/hooks/use-config";
import { useMenuHoverConfig } from "@/hooks/use-menu-hover";
import { useMediaQuery } from "@/hooks/use-media-query";
const Logo = () => {
2024-11-28 17:23:53 +00:00
const [config] = useConfig();
const [hoverConfig] = useMenuHoverConfig();
const { hovered } = hoverConfig;
const isDesktop = useMediaQuery("(min-width: 1280px)");
2024-11-26 03:09:48 +00:00
2024-11-28 17:23:53 +00:00
if (config.sidebar === "compact") {
2024-11-26 03:09:48 +00:00
return (
2024-11-28 17:23:53 +00:00
<Link
href="/dashboard/analytics"
className="flex gap-2 items-center justify-center "
>
<DashCodeLogo className=" text-default-900 h-8 w-8 [&>path:nth-child(3)]:text-background [&>path:nth-child(2)]:text-background" />
</Link>
2024-11-26 03:09:48 +00:00
);
2024-11-28 17:23:53 +00:00
}
if (config.sidebar === "two-column" || !isDesktop) return null;
return (
<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" />
{(!config?.collapsed || hovered) && (
<h1 className="text-xl font-semibold text-default-900 ">D</h1>
)} */}
<img src="/../images/all-img/mediahub-logo.png" alt="logo" width={150} />
</Link>
);
2024-11-26 03:09:48 +00:00
};
export default Logo;