From a74f41228d8377390b25267905953fa4b627b97a Mon Sep 17 00:00:00 2001 From: kent Date: Tue, 6 Jan 2026 21:20:31 +0900 Subject: [PATCH] =?UTF-8?q?feat(WEB):=20=EC=A2=85=ED=95=A9=EB=B6=84?= =?UTF-8?q?=EC=84=9D=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EA=B0=9C?= =?UTF-8?q?=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 목데이터 적용 및 UI 개선 --- .../reports/ComprehensiveAnalysis/index.tsx | 70 +++++++++++++------ 1 file changed, 50 insertions(+), 20 deletions(-) diff --git a/src/components/reports/ComprehensiveAnalysis/index.tsx b/src/components/reports/ComprehensiveAnalysis/index.tsx index 15d2a507..3f6e6718 100644 --- a/src/components/reports/ComprehensiveAnalysis/index.tsx +++ b/src/components/reports/ComprehensiveAnalysis/index.tsx @@ -280,28 +280,29 @@ export default function ComprehensiveAnalysis({ initialData }: ComprehensiveAnal const [rejectTargetId, setRejectTargetId] = useState(null); const [rejectReason, setRejectReason] = useState(''); - // 데이터 로드 (API 연동 시 활성화) - // const loadData = useCallback(async () => { - // setIsLoading(true); - // try { - // const result = await getComprehensiveAnalysis(); - // if (result.success && result.data) { - // setData(result.data); - // } - // } catch (error) { - // console.error('Failed to load comprehensive analysis:', error); - // } finally { - // setIsLoading(false); - // } - // }, []); - - // 초기 로드 - 현재 목데이터 사용 중 (API 연동 시 활성화) - useEffect(() => { - // API 연동 시 아래 주석 해제 - // loadData(); - setIsLoading(false); + // 데이터 로드 + const loadData = useCallback(async () => { + setIsLoading(true); + try { + const result = await getComprehensiveAnalysis(); + if (result.success && result.data) { + setData(result.data); + } else if (result.error) { + toast.error(result.error); + } + } catch (error) { + console.error('Failed to load comprehensive analysis:', error); + toast.error('데이터를 불러오는데 실패했습니다.'); + } finally { + setIsLoading(false); + } }, []); + // 초기 로드 + useEffect(() => { + loadData(); + }, [loadData]); + const handleReceivableDetail = () => { router.push('/ko/accounting/receivables-status'); }; @@ -370,12 +371,41 @@ export default function ComprehensiveAnalysis({ initialData }: ComprehensiveAnal ? data.todayIssue.items : data.todayIssue.items.filter(item => item.category === issueFilter); + if (isLoading) { + return ( + + +
+
+ +

데이터를 불러오는 중...

+
+
+
+ ); + } + return ( + + 새로고침 + + } />