forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogo.tsx
More file actions
53 lines (48 loc) · 1.34 KB
/
Copy pathlogo.tsx
File metadata and controls
53 lines (48 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
"use client";
import Image from "next/image";
import Link from "fumadocs-core/link";
import { cn } from "@/lib/utils";
interface LogoProps {
className?: string;
width?: number;
height?: number;
}
const DESKTOP_WIDTH = 179;
const DESKTOP_HEIGHT = 26;
const COMMON_CLASSNAMES =
"aspect-[179/26] w-[164px] h-[24px] lg:w-[179px] lg:h-[26px] shrink-0";
export function Logo({
className,
width = DESKTOP_WIDTH,
height = DESKTOP_HEIGHT,
}: LogoProps) {
const handleLogoClick = (e: React.MouseEvent) => {
// Clear the integration selection from sessionStorage (tab-specific)
sessionStorage.removeItem("selectedIntegration");
sessionStorage.setItem("lastDocsPath", "/");
// Dispatch custom event to notify IntegrationSelector
window.dispatchEvent(new CustomEvent("clearIntegrationSelection"));
};
return (
<Link
href="/"
onClick={handleLogoClick}
className={cn("flex justify-center items-center", className)}
>
<Image
src="/images/logo-light.svg"
width={width}
height={height}
alt="CopilotKit"
className={cn("block dark:hidden", COMMON_CLASSNAMES)}
/>
<Image
src="/images/logo-dark.svg"
width={width}
height={height}
alt="CopilotKit"
className={cn("hidden dark:block", COMMON_CLASSNAMES)}
/>
</Link>
);
}