diff --git a/TestMasterUI/src/components/MainContentArea.jsx b/TestMasterUI/src/components/MainContentArea.jsx index 7a690e1..398b032 100644 --- a/TestMasterUI/src/components/MainContentArea.jsx +++ b/TestMasterUI/src/components/MainContentArea.jsx @@ -1,28 +1,50 @@ import React, {useEffect, useState} from 'react'; -import APINavigation from "@/components/api-tester/APINavigation"; -import APITabs from "@/components/api-tester/APITabs"; -import { useAPI } from '@/providers/APIProvider.jsx'; +import APINavigation from '@/components/api-tester/APINavigation'; +import APITabs from '@/components/api-tester/APITabs'; +import {useAPI} from '@/providers/APIProvider.jsx'; import ScenarioNavigation from '@/components/api-tester/ScenarioNavigation.jsx'; import ScenarioEditor from '@/components/api-tester/ScenarioEditor.jsx'; -const MainContentArea = ({ isApiMode, toggleMode }) => { +const MainContentArea = ({isApiMode, toggleMode}) => { + // Lift tab state up + const [apiRequests, setApiRequests] = useState([]); + const [currentIndex, setCurrentIndex] = useState(0); + return (
- {isApiMode ? : } + {isApiMode ? ( + + ) : ( + + )}
); }; // API 모드 -const APIMode = ({ isApiMode, onToggleMode }) => { - const [apiRequests, setApiRequests] = useState([]); - const [currentIndex, setCurrentIndex] = useState(0); - const { - collections, - loadCollections, - loading, - error - } = useAPI(); +const APIMode = ({ + isApiMode, + onToggleMode, + apiRequests, + setApiRequests, + currentIndex, + setCurrentIndex +}) => { + const {collections, loadCollections} = useAPI(); useEffect(() => { loadCollections(); @@ -127,40 +149,35 @@ const APIMode = ({ isApiMode, onToggleMode }) => { }; // 시나리오 모드 -const ScenarioMode = ({ isApiMode, onToggleMode }) => ( -
- {/* 왼쪽 고정: ScenarioNavigation */} -
- +const ScenarioMode = ({ + isApiMode, + onToggleMode, +}) => { + + return ( +
+
+ +
+
+ +
+
+ +
+ ); +}; - {/* 중앙: ScenarioEditor */} -
- -
- - {/* 오른쪽 고정: APINavigation */} -
- { - // Handle API selection - }} - onNewCollection={() => { - // Handle new collection creation - }} - isApiMode={isApiMode} - onToggleMode={onToggleMode} - /> - -
-
-); - - -export default MainContentArea; + export default MainContentArea;