feat: initialize backend database service architecture and implement frontend schema explorer components
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
import React from 'react';
|
||||
import { Box, Tooltip, IconButton, Stack } from '@mui/material';
|
||||
import {
|
||||
Storage,
|
||||
Terminal,
|
||||
FileUpload,
|
||||
Settings,
|
||||
History
|
||||
} from '@mui/icons-material';
|
||||
|
||||
interface NavigationRailProps {
|
||||
activeTab: string;
|
||||
onTabChange: (tab: string) => void;
|
||||
}
|
||||
|
||||
const NavigationRail: React.FC<NavigationRailProps> = ({ activeTab, onTabChange }) => {
|
||||
const tabs = [
|
||||
{ id: 'explorer', icon: <Storage />, label: 'Explorer' },
|
||||
{ id: 'sql', icon: <Terminal />, label: 'SQL Editor' },
|
||||
{ id: 'transfer', icon: <FileUpload />, label: 'Import/Export' },
|
||||
{ id: 'history', icon: <History />, label: 'Query History' },
|
||||
];
|
||||
|
||||
return (
|
||||
<Box sx={{
|
||||
width: 60,
|
||||
height: '100vh',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
py: 2,
|
||||
bgcolor: 'rgba(0,0,0,0.1)',
|
||||
borderRight: 1,
|
||||
borderColor: 'divider'
|
||||
}}>
|
||||
<Stack spacing={2}>
|
||||
{tabs.map((tab) => (
|
||||
<Tooltip key={tab.id} title={tab.label} placement="right">
|
||||
<IconButton
|
||||
onClick={() => onTabChange(tab.id)}
|
||||
sx={{
|
||||
color: activeTab === tab.id ? 'primary.main' : 'text.secondary',
|
||||
bgcolor: activeTab === tab.id ? 'rgba(0, 97, 255, 0.1)' : 'transparent',
|
||||
borderRadius: 2,
|
||||
'&:hover': { bgcolor: 'rgba(0, 97, 255, 0.05)' }
|
||||
}}
|
||||
>
|
||||
{tab.icon}
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
))}
|
||||
</Stack>
|
||||
|
||||
<Box sx={{ mt: 'auto' }}>
|
||||
<Tooltip title="Settings" placement="right">
|
||||
<IconButton sx={{ color: 'text.secondary' }}>
|
||||
<Settings />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export default NavigationRail;
|
||||
Reference in New Issue
Block a user