@@ -22,7 +22,6 @@ import {
2222 MIN_SIDEBAR_WIDTH ,
2323 NARROW_SIDEBAR_WIDTH ,
2424 Path ,
25- PLUGINS ,
2625 REPO_URL ,
2726} from "../constant" ;
2827
@@ -32,6 +31,12 @@ import dynamic from "next/dynamic";
3231import { showConfirm , Selector } from "./ui-lib" ;
3332import clsx from "clsx" ;
3433
34+ const DISCOVERY = [
35+ { name : Locale . Plugin . Name , path : Path . Plugins } ,
36+ { name : "Stable Diffusion" , path : Path . Sd } ,
37+ { name : Locale . SearchChat . Page . Title , path : Path . SearchChat } ,
38+ ] ;
39+
3540const ChatList = dynamic ( async ( ) => ( await import ( "./chat-list" ) ) . ChatList , {
3641 loading : ( ) => null ,
3742} ) ;
@@ -219,7 +224,7 @@ export function SideBarTail(props: {
219224export function SideBar ( props : { className ?: string } ) {
220225 useHotKey ( ) ;
221226 const { onDragStart, shouldNarrow } = useDragSideBar ( ) ;
222- const [ showPluginSelector , setShowPluginSelector ] = useState ( false ) ;
227+ const [ showDiscoverySelector , setshowDiscoverySelector ] = useState ( false ) ;
223228 const navigate = useNavigate ( ) ;
224229 const config = useAppConfig ( ) ;
225230 const chatStore = useChatStore ( ) ;
@@ -254,21 +259,21 @@ export function SideBar(props: { className?: string }) {
254259 icon = { < DiscoveryIcon /> }
255260 text = { shouldNarrow ? undefined : Locale . Discovery . Name }
256261 className = { styles [ "sidebar-bar-button" ] }
257- onClick = { ( ) => setShowPluginSelector ( true ) }
262+ onClick = { ( ) => setshowDiscoverySelector ( true ) }
258263 shadow
259264 />
260265 </ div >
261- { showPluginSelector && (
266+ { showDiscoverySelector && (
262267 < Selector
263268 items = { [
264- ...PLUGINS . map ( ( item ) => {
269+ ...DISCOVERY . map ( ( item ) => {
265270 return {
266271 title : item . name ,
267272 value : item . path ,
268273 } ;
269274 } ) ,
270275 ] }
271- onClose = { ( ) => setShowPluginSelector ( false ) }
276+ onClose = { ( ) => setshowDiscoverySelector ( false ) }
272277 onSelection = { ( s ) => {
273278 navigate ( s [ 0 ] , { state : { fromHome : true } } ) ;
274279 } }
0 commit comments