mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
541e7e315c
File outline for React IDE page GitOrigin-RevId: 18bfad1d59c5be5f1a2808f8ede62fe95e595dc5
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import React from 'react'
|
|
import { Panel, PanelGroup } from 'react-resizable-panels'
|
|
import { VerticalResizeHandle } from '@/features/ide-react/components/resize/vertical-resize-handle'
|
|
import { FileTree } from '@/features/ide-react/components/file-tree'
|
|
import { FileTreeSelectHandler } from '@/features/ide-react/types/file-tree'
|
|
|
|
type EditorSidebarProps = {
|
|
shouldPersistLayout: boolean
|
|
onFileTreeInit: () => void
|
|
onFileTreeSelect: FileTreeSelectHandler
|
|
}
|
|
|
|
export default function EditorSidebar({
|
|
shouldPersistLayout,
|
|
onFileTreeInit,
|
|
onFileTreeSelect,
|
|
}: EditorSidebarProps) {
|
|
return (
|
|
<aside className="ide-react-placeholder-editor-sidebar">
|
|
<PanelGroup
|
|
autoSaveId={
|
|
shouldPersistLayout ? 'ide-react-editor-sidebar-layout' : undefined
|
|
}
|
|
direction="vertical"
|
|
>
|
|
<Panel defaultSize={75} className="ide-react-file-tree-panel">
|
|
<FileTree onInit={onFileTreeInit} onSelect={onFileTreeSelect} />
|
|
</Panel>
|
|
<VerticalResizeHandle />
|
|
<Panel defaultSize={25}>
|
|
<div className="outline-container" />
|
|
</Panel>
|
|
</PanelGroup>
|
|
</aside>
|
|
)
|
|
}
|