import React, { useEffect, useRef, useState } from "react";
import {
BookOpen,
Briefcase,
Cpu,
GitHub,
Key,
Menu,
Plus,
} from "react-feather";
import IndexCount from "./IndexCount";
import LLMStatus from "./LLMStatus";
import KeysModal, { useKeysModal } from "../Modals/Keys";
import NewWorkspaceModal, {
useNewWorkspaceModal,
} from "../Modals/NewWorkspace";
import ActiveWorkspaces from "./ActiveWorkspaces";
import paths from "../../utils/paths";
export default function Sidebar() {
const sidebarRef = useRef(null);
const {
showing: showingKeyModal,
showModal: showKeyModal,
hideModal: hideKeyModal,
} = useKeysModal();
const {
showing: showingNewWsModal,
showModal: showNewWsModal,
hideModal: hideNewWsModal,
} = useNewWorkspaceModal();
return (
<>
{/* Header Information */}
{/* Primary Body */}
{showingKeyModal && }
{showingNewWsModal && }
>
);
}
export function SidebarMobileHeader() {
const [showSidebar, setShowSidebar] = useState(false);
const [showBgOverlay, setShowBgOverlay] = useState(false);
const sidebarRef = useRef(null);
const {
showing: showingKeyModal,
showModal: showKeyModal,
hideModal: hideKeyModal,
} = useKeysModal();
const {
showing: showingNewWsModal,
showModal: showNewWsModal,
hideModal: hideNewWsModal,
} = useNewWorkspaceModal();
useEffect(() => {
function handleBg() {
if (showSidebar) {
setTimeout(() => {
setShowBgOverlay(true);
}, 300);
} else {
setShowBgOverlay(false);
}
}
handleBg();
}, [showSidebar]);
return (
<>
AnythingLLM
setShowSidebar(false)}
/>
{/* Header Information */}
{/* Primary Body */}
{showingKeyModal &&
}
{showingNewWsModal &&
}
>
);
}