OperationPanel.tsx 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import { Divider, Flex } from 'antd';
  2. import { useSelector } from 'react-redux';
  3. import FunctionArea from './FunctionArea';
  4. import TransferArea from './TransferArea';
  5. import SendPanelForView from '../../output/SendPanelForView';
  6. import MeasurementPanel from './MeasurementPanel';
  7. import MorePanel from './MorePanel';
  8. import AdvancedProcessingPanel from './AdvancedProcessingPanel';
  9. import RectCropPanel from './RectCropPanel';
  10. import MarkPanel from './MarkPanel';
  11. import ImageStateControl from './ImageStateControl';
  12. import { RootState } from '../../../states/store';
  13. import SliderAdjustmentPanel from './SliderAdjustmentPanel';
  14. const OperationPanel = () => {
  15. const currentPanel = useSelector(
  16. (state: RootState) => state.panelSwitchForView.currentPanel
  17. );
  18. const renderPanel = () => {
  19. switch (currentPanel) {
  20. case 'OperationPanel':
  21. return (
  22. <Flex
  23. vertical
  24. gap="small"
  25. style={{
  26. height: '100%',
  27. overflowY: 'auto',
  28. //padding: '0.5rem'
  29. }}
  30. >
  31. <FunctionArea />
  32. <Divider style={{ margin: 0 }} />
  33. <ImageStateControl />
  34. <Divider style={{ margin: 0 }} />
  35. <TransferArea />
  36. </Flex>
  37. );
  38. case 'SendPanel':
  39. return <SendPanelForView />;
  40. case 'MeasurementPanel':
  41. return <MeasurementPanel />;
  42. case 'MorePanel':
  43. return <MorePanel />;
  44. case 'AdvancedProcessingPanel':
  45. return <AdvancedProcessingPanel />;
  46. case 'RectCropPanel':
  47. return <RectCropPanel />;
  48. case 'MarkPanel':
  49. return <MarkPanel />;
  50. case 'SliderAdjustmentPanel':
  51. return <SliderAdjustmentPanel />
  52. default:
  53. return (
  54. <Flex
  55. vertical
  56. gap="small"
  57. style={{
  58. height: '100%',
  59. overflowY: 'auto',
  60. padding: '0.5rem'
  61. }}
  62. >
  63. <FunctionArea />
  64. <Divider style={{ margin: 0 }} />
  65. <ImageStateControl />
  66. <Divider style={{ margin: 0 }} />
  67. <TransferArea />
  68. </Flex>
  69. );
  70. }
  71. };
  72. return <div style={{ height: '100%' }}>{renderPanel()}</div>;
  73. };
  74. export default OperationPanel;