import { useMemo } from 'react'; import { useLocation } from 'react-router-dom'; import { Button, Sidebar, TooltipAnchor } from '@librechat/client'; import ManagePrompts from '~/components/Prompts/ManagePrompts'; import { usePromptGroupsContext } from '~/Providers'; import List from '~/components/Prompts/Groups/List'; import PanelNavigation from './PanelNavigation'; import { useLocalize } from '~/hooks'; import { cn } from '~/utils'; export default function GroupSidePanel({ children, className = '', closePanelRef, onClose, }: { children?: React.ReactNode; className?: string; closePanelRef?: React.RefObject; onClose?: () => void; }) { const location = useLocation(); const localize = useLocalize(); const isChatRoute = useMemo(() => location.pathname?.startsWith('/c/'), [location.pathname]); const { promptGroups, groupsQuery, nextPage, prevPage, hasNextPage, hasPreviousPage } = usePromptGroupsContext(); return (
{onClose && (
} />
)}
{children}
{isChatRoute && }
); }