import React from 'react'; import { Button, Flex } from 'antd'; import '@/themes/truncateText.css'; import { useDispatch } from 'react-redux'; import { setAction } from '@/states/view/functionAreaSlice'; import { switchToMeasurementPanel, switchToMorePanel, switchToAdvancedProcessingPanel, switchToRectCropPanel } from '@/states/panelSwitchSliceForView'; import Icon from '@/components/Icon'; import { showNotImplemented } from '@/utils/notificationHelper'; const FunctionButton = ({ title, action, iconName, }: { title: string; action: string; iconName: string; }) => { const dispatch = useDispatch(); const handleButtonClick = () => { if (action === 'AddMask' || action === 'Delete Digital Mask' || action === 'Crop Selected Area' || ['Delete Mask', 'Image Comparison', 'Zoom Image', 'Reset Cursor', 'Pan', 'Snapshot', ].includes(action) ) { showNotImplemented(''); return; } if (action === 'Image Measurement') { // 切换到测量面板 dispatch(switchToMeasurementPanel()); } else if (action === 'Rectangle Crop') { // 切换到矩形裁剪面板 dispatch(switchToRectCropPanel()); } else if (action === 'More') { // 切换到更多功能面板 dispatch(switchToMorePanel()); } else if (action === 'Advanced Processing') { // 切换到高级图像处理面板 dispatch(switchToAdvancedProcessingPanel()); } else { // 其他功能按钮保持原有逻辑 dispatch(setAction(action)); } }; return ( ); }; const FunctionArea = () => { return ( ); }; export default FunctionArea;