suna/frontend/src/components/dashboard/sidebar/kortix-logo.tsx

29 lines
675 B
TypeScript
Raw Normal View History

2025-04-16 04:45:46 +08:00
"use client"
import Image from "next/image"
import { useSidebar } from "@/components/ui/sidebar"
2025-04-16 08:04:04 +08:00
import { useTheme } from "next-themes"
import { useEffect, useState } from "react"
2025-04-16 04:45:46 +08:00
export function KortixLogo() {
const { state } = useSidebar()
2025-04-16 08:04:04 +08:00
const { theme } = useTheme()
const [mounted, setMounted] = useState(false)
// After mount, we can access the theme
useEffect(() => {
setMounted(true)
}, [])
2025-04-16 04:45:46 +08:00
return (
<div className="flex items-center">
<Image
src="/kortix-symbol.svg"
alt="Kortix"
width={24}
height={24}
2025-04-16 08:04:04 +08:00
className={`${mounted && theme === 'dark' ? 'invert' : ''}`}
2025-04-16 04:45:46 +08:00
/>
</div>
)
}