);
-}
+});
+
+export default PlatformRoasTable;
diff --git a/src/hooks/common/useIsMounted.ts b/src/hooks/common/useIsMounted.ts
index 1b861818..fbf35513 100644
--- a/src/hooks/common/useIsMounted.ts
+++ b/src/hooks/common/useIsMounted.ts
@@ -5,8 +5,7 @@ export function useIsMounted() {
const [isMounted, setIsMounted] = useState(false);
useEffect(() => {
- const raf = requestAnimationFrame(() => setIsMounted(true));
- return () => cancelAnimationFrame(raf);
+ setIsMounted(true);
}, []);
return isMounted;
diff --git a/src/pages/dashboard/overview/OverviewDashboard.tsx b/src/pages/dashboard/overview/OverviewDashboard.tsx
index 7b692d35..a72af643 100644
--- a/src/pages/dashboard/overview/OverviewDashboard.tsx
+++ b/src/pages/dashboard/overview/OverviewDashboard.tsx
@@ -1,4 +1,4 @@
-import { useMemo, useState } from "react";
+import { lazy, Suspense, useState } from "react";
import { useNavigate } from "react-router-dom";
import { toast } from "sonner";
@@ -22,7 +22,6 @@ import TrafficChart, {
import PlatformRoasTable from "@/components/dashboard/platform/PlatformRoasTable";
import { overviewMockData } from "./overview.mock";
-import OverviewAiReportPanel from "./OverviewAiReportPanel";
import ChevronDoubleRightIcon from "@/assets/icon/chevron/chervon-double-right.svg?react";
import DownloadIcon from "@/assets/icon/common/download.svg?react";
@@ -30,6 +29,8 @@ import LinkIcon from "@/assets/icon/common/link.svg?react";
import WarnCircleIcon from "@/assets/icon/common/warn-circle.svg?react";
import AiButtonSvg from "@/assets/logo/service-logo/ai-요약버튼.svg?react";
+const OverviewAiReportPanel = lazy(() => import("./OverviewAiReportPanel"));
+
export default function OverviewDashboard() {
const navigate = useNavigate();
const [isAiPanelOpen, setIsAiPanelOpen] = useState(false);
@@ -43,17 +44,15 @@ export default function OverviewDashboard() {
}),
);
- const budgetStatusBadge = useMemo(() => {
- const { totalBudget, spent, warningThreshold, dangerThreshold } =
- budgetGaugeChartMock;
- const pct = totalBudget > 0 ? Math.round((spent / totalBudget) * 100) : 0;
- const status = getBudgetStatus(pct, warningThreshold, dangerThreshold);
- return (
-
- {status}
-
- );
- }, []);
+ const { totalBudget, spent, warningThreshold, dangerThreshold } =
+ budgetGaugeChartMock;
+ const budgetPct =
+ totalBudget > 0 ? Math.round((spent / totalBudget) * 100) : 0;
+ const budgetStatus = getBudgetStatus(
+ budgetPct,
+ warningThreshold,
+ dangerThreshold,
+ );
return (
@@ -67,8 +66,8 @@ export default function OverviewDashboard() {
className="group relative p-2 -mr-2 rounded-2xl outline-none cursor-pointer overflow-hidden"
aria-label="AI 요약하기"
>
-
-
+
+
@@ -109,7 +108,15 @@ export default function OverviewDashboard() {
]}
/>
}
- RightElement={budgetStatusBadge}
+ RightElement={
+
+ {budgetStatus}
+
+ }
>
@@ -121,12 +128,12 @@ export default function OverviewDashboard() {
}
description={
@@ -147,7 +154,7 @@ export default function OverviewDashboard() {
onClose={() => setIsAiPanelOpen(false)}
hideHeader={false}
disableScroll={false}
- className="w-full max-w-160 tablet:max-w-full"
+ className="w-full max-w-160"
dropdownItems={[
{
label: "링크 공유하기",
@@ -178,7 +185,11 @@ export default function OverviewDashboard() {
},
]}
>
-
+ {isAiPanelOpen && (
+
+
+
+ )}
);