From 985a2c303980ba09314c2a875b99b74350682223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=98=84=EC=84=B1=ED=95=84?= Date: Sat, 25 Jan 2025 10:44:51 +0900 Subject: [PATCH] =?UTF-8?q?=ED=83=AD=20=EC=B2=98=EB=A6=AC=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/MainContentArea.jsx | 115 ++++++++++-------- 1 file changed, 66 insertions(+), 49 deletions(-) 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;