import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { memo } from 'react';
import { FlaskConical } from 'lucide-react';
import { useResearchStore } from '../../stores/researchStore';
import { useResearchSessions } from '../../hooks/useResearch';
export const ResearchSidebarToggle = memo(function ResearchSidebarToggle({ parentSessionId, }) {
    const isExpanded = useResearchStore((state) => state.isExpanded);
    const toggleSidebar = useResearchStore((state) => state.toggleSidebar);
    const { data } = useResearchSessions(parentSessionId ?? null);
    const sessionCount = data?.sessions?.length ?? 0;
    return (_jsxs("button", { type: "button", onClick: toggleSidebar, className: `relative h-14 w-full transition-colors touch-manipulation flex items-center justify-center ${isExpanded ? 'bg-muted border-r-2 border-primary' : 'hover:bg-muted/50'}`, title: "Research (\u2318\u21E7R)", children: [_jsx(FlaskConical, { className: "w-5 h-5 text-muted-foreground mx-auto" }), sessionCount > 0 && (_jsx("span", { className: "absolute top-1 right-1 w-5 h-5 bg-primary text-primary-foreground text-xs rounded-full flex items-center justify-center font-semibold", children: sessionCount > 9 ? '9+' : sessionCount }))] }));
});
//# sourceMappingURL=ResearchSidebarToggle.js.map