mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-07 00:14:25 +00:00
Reorganize components
This commit is contained in:
37
frontend/src/components/layout/Sidebar.jsx
Normal file
37
frontend/src/components/layout/Sidebar.jsx
Normal file
@@ -0,0 +1,37 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import { Box } from '@mantine/core';
|
||||
import FileActions from '../files/FileActions';
|
||||
import FileTree from '../files/FileTree';
|
||||
import { useGitOperations } from '../../hooks/useGitOperations';
|
||||
import { useWorkspace } from '../../contexts/WorkspaceContext';
|
||||
|
||||
const Sidebar = ({ selectedFile, handleFileSelect, files, loadFileList }) => {
|
||||
const { settings } = useWorkspace();
|
||||
const { handlePull } = useGitOperations(settings.gitEnabled);
|
||||
|
||||
useEffect(() => {
|
||||
loadFileList();
|
||||
}, [loadFileList]);
|
||||
|
||||
return (
|
||||
<Box
|
||||
style={{
|
||||
width: '25%',
|
||||
minWidth: '200px',
|
||||
maxWidth: '300px',
|
||||
borderRight: '1px solid var(--app-shell-border-color)',
|
||||
height: '100%',
|
||||
overflow: 'hidden',
|
||||
}}
|
||||
>
|
||||
<FileActions handlePullChanges={handlePull} selectedFile={selectedFile} />
|
||||
<FileTree
|
||||
files={files}
|
||||
handleFileSelect={handleFileSelect}
|
||||
selectedFile={selectedFile}
|
||||
/>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export default Sidebar;
|
||||
Reference in New Issue
Block a user