import { ArrowRight, PlayCircle } from "lucide-react"; import type { ReactNode } from "react"; import { FloatingSidebarRail } from "@/components/home/floating-sidebar-shell"; 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"; type SidebarItem = { iconUrl?: string | null; label: string; }; type LovartSidebarProps = { 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; onProfile: () => 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; toolbox1Enabled: boolean; toolbox1Links: NavLink[]; toolbox2Enabled: boolean; toolbox2Links: NavLink[]; tutorialEnabled: boolean; tutorialVideos: TutorialVideo[]; videoCanvasEnabled: boolean; }; export function LovartSidebar({ agentEnabled, getItem, isEnabled, isProjectsOnlyView, onAllProjects, onGallery, onHome, onImageEditor, onNavLink, onNewCanvas, onProfile, onRoute, onTutorial, productPlanningEnabled, renderIcon, settingsHref, toolbox1Enabled, toolbox1Links, toolbox2Enabled, toolbox2Links, tutorialEnabled, tutorialVideos, videoCanvasEnabled, }: LovartSidebarProps) { const sidebarPopupBaseClass = "rounded-[24px] border border-black/8 bg-white/96 p-2.5 text-[#111827] shadow-[0_24px_64px_rgba(15,23,42,0.12)] backdrop-blur-xl"; const sidebarButtonClass = (active = false) => [ "group flex h-10 w-10 items-center justify-center rounded-xl text-[#6b7280] transition-all duration-200 hover:bg-black/[0.04] hover:text-[#111827]", active ? "bg-[#111827] text-white shadow-[0_10px_22px_rgba(15,23,42,0.18)]" : "", ] .filter(Boolean) .join(" "); const tooltipButton = ( key: LovartHomeSidebarItemKey, onClick: () => void, options?: { active?: boolean } ) => isEnabled(key) ? ( {renderIcon(key, { active: options?.active })} {getItem(key).label} ) : null; const toolbox = ( key: "toolbox1" | "toolbox2", links: NavLink[], enabled: boolean ) => isEnabled(key) && enabled && links.length > 0 ? ( {renderIcon(key)} {getItem(key).label} {links.map((link) => ( onNavLink(link.url)} > {link.name} ))} ) : null; return ( ); }