feat(knowledge): add knowledge base detail page components and hooks
refactor(knowledge): restructure knowledge detail page with new components feat(components): add FileUploadDialog for file upload functionality feat(hooks): implement document management hooks for CRUD operations
This commit is contained in:
70
src/pages/knowledge/components/FloatingActionButtons.tsx
Normal file
70
src/pages/knowledge/components/FloatingActionButtons.tsx
Normal file
@@ -0,0 +1,70 @@
|
||||
import React from 'react';
|
||||
import { SpeedDial, SpeedDialAction } from '@mui/material';
|
||||
import {
|
||||
Settings as SettingsIcon,
|
||||
Search as TestIcon,
|
||||
Settings as ConfigIcon,
|
||||
} from '@mui/icons-material';
|
||||
|
||||
interface FloatingActionButtonsProps {
|
||||
onTestClick: () => void;
|
||||
onConfigClick: () => void;
|
||||
}
|
||||
|
||||
const FloatingActionButtons: React.FC<FloatingActionButtonsProps> = ({
|
||||
onTestClick,
|
||||
onConfigClick,
|
||||
}) => {
|
||||
const actions = [
|
||||
{
|
||||
icon: <TestIcon />,
|
||||
name: '检索测试',
|
||||
onClick: onTestClick,
|
||||
},
|
||||
{
|
||||
icon: <ConfigIcon />,
|
||||
name: '配置设置',
|
||||
onClick: onConfigClick,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<SpeedDial
|
||||
ariaLabel="知识库操作"
|
||||
sx={{
|
||||
position: 'fixed',
|
||||
bottom: 128,
|
||||
right: 64,
|
||||
'& .MuiSpeedDial-fab': {
|
||||
bgcolor: 'primary.main',
|
||||
'&:hover': {
|
||||
bgcolor: 'primary.dark',
|
||||
},
|
||||
},
|
||||
}}
|
||||
icon={<SettingsIcon />}
|
||||
>
|
||||
{actions.map((action) => (
|
||||
<SpeedDialAction
|
||||
key={action.name}
|
||||
icon={action.icon}
|
||||
slotProps={{
|
||||
tooltip: {
|
||||
title: action.name,
|
||||
sx: {
|
||||
bgcolor: 'primary.main',
|
||||
color: 'white',
|
||||
":hover": {
|
||||
bgcolor: 'primary.dark',
|
||||
},
|
||||
},
|
||||
},
|
||||
}}
|
||||
onClick={action.onClick}
|
||||
/>
|
||||
))}
|
||||
</SpeedDial>
|
||||
);
|
||||
};
|
||||
|
||||
export default FloatingActionButtons;
|
||||
Reference in New Issue
Block a user