import { ArrowRight, PlayCircle } from "lucide-react"; import type { ReactNode } from "react"; import { HoverCard, HoverCardContent, HoverCardTrigger, } from "@/components/ui/hover-card"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; import type { LovartHomeSidebarItemKey } from "@/lib/home/lovart-sidebar-config"; import type { NavLink, TutorialVideo } from "./types"; import { HomeImage } from "./home-image"; type SidebarItem = { iconUrl?: string | null; label: string; }; type LovartSidebarProps = { accountControls?: ReactNode; agentEnabled: boolean; getItem: (key: LovartHomeSidebarItemKey) => SidebarItem; isEnabled: (key: LovartHomeSidebarItemKey) => boolean; isProjectsOnlyView: boolean; onAllProjects: () => void; onGallery: () => void; onHome: () => void; onImageEditor: () => void; onNavLink: (url: string) => void; onNewCanvas: () => void; onRoute: (url: string) => void; onTutorial: (video: TutorialVideo) => void; productPlanningEnabled: boolean; renderIcon: ( key: LovartHomeSidebarItemKey, options?: { active?: boolean; filled?: boolean; sizeClassName?: string; } ) => ReactNode; settingsHref: string | null; siteLogo?: string | null; siteName: string; toolbox1Enabled: boolean; toolbox1Links: NavLink[]; toolbox2Enabled: boolean; toolbox2Links: NavLink[]; topOffset?: number; tutorialEnabled: boolean; tutorialVideos: TutorialVideo[]; videoCanvasEnabled: boolean; tone?: "light" | "dark"; }; export function LovartSidebar({ accountControls, agentEnabled, getItem, isEnabled, isProjectsOnlyView, onAllProjects, onGallery, onHome, onImageEditor, onNavLink, onNewCanvas, onRoute, onTutorial, productPlanningEnabled, renderIcon, settingsHref, siteLogo, siteName, toolbox1Enabled, toolbox1Links, toolbox2Enabled, toolbox2Links, topOffset = 0, tutorialEnabled, tutorialVideos, videoCanvasEnabled, tone = "light", }: LovartSidebarProps) { const isDark = tone === "dark"; const sidebarPopupBaseClass = "rounded-[12px] border border-black/8 bg-white/96 p-2 text-[#111827] shadow-[0_18px_44px_rgba(15,23,42,0.12)] backdrop-blur-xl dark:border-white/10 dark:bg-[#141416]/96 dark:text-white dark:shadow-[0_18px_44px_rgba(0,0,0,0.4)]"; const sidebarButtonClass = (active = false) => [ "group flex h-[36px] w-[36px] shrink-0 items-center justify-center rounded-[8px] text-[#202020] transition-colors duration-150 hover:bg-[#f5f5f5] dark:text-white dark:hover:bg-white/10", active ? "bg-[#e5e5e5] text-[#202020] dark:bg-white/10 dark:text-white" : "", ] .filter(Boolean) .join(" "); const tooltipButton = ( key: LovartHomeSidebarItemKey, onClick: () => void, options?: { active?: boolean } ) => isEnabled(key) ? ( {getItem(key).label} ) : null; const toolbox = ( key: "toolbox1" | "toolbox2", links: NavLink[], enabled: boolean ) => isEnabled(key) && enabled && links.length > 0 ? (
{getItem(key).label}
{links.map((link) => ( ))}
) : null; return ( ); }