[st] - tab & menu 로직 수정

This commit is contained in:
2026-06-15 16:34:02 +09:00
parent 44c5d66afa
commit f21dde8f7d
13 changed files with 690 additions and 23 deletions
@@ -8,6 +8,11 @@ import { SkeletonPage } from "@/shared/ui/skeleton-page";
import "@rsone/components/index.css";
import Dashboard from "@/components/statistics/Dashboard";
import { isBbsNoticeMenu } from "@/shared/lib/bbs-notice-menu";
import {
parseStatisticsMenuUrlPath,
resolveStatisticsCategory,
} from "@/shared/lib/statistics-menu-url";
import { isVerificationSelectionReportMenu } from "@/shared/lib/verification-selection-report";
import { useAdminStore } from "@/store/admin-store";
import { useTabStore } from "@/store/tab-store";
@@ -18,7 +23,9 @@ const StatisticsPage = () => {
const tabsForBody = useMemo(
() =>
tabs.filter(
(tab) => !isVerificationSelectionReportMenu(tab.menuItem),
(tab) =>
!isVerificationSelectionReportMenu(tab.menuItem) &&
!isBbsNoticeMenu(tab.menuItem),
),
[tabs],
);
@@ -57,13 +64,17 @@ const StatisticsPage = () => {
{tabsForBody.map((tab) => {
// 렌더링 시점에 컴포넌트가 없으면 바로 로드
if (!componentCache.current.has(tab.id)) {
const componentName = tab.urlPath;
const parentComponentName = tab.parentEngNm;
const { componentName } = parseStatisticsMenuUrlPath(tab.urlPath);
const category = resolveStatisticsCategory(
tab.urlPath,
tab.parentEngNm,
);
const resolvedComponentName = componentName || tab.urlPath;
const DynamicComponent = dynamic(
() =>
import(
`@/components/statistics${parentComponentName ? `/${parentComponentName}` : ""}/${componentName}`
`@/components/statistics/${category}/${resolvedComponentName}`
),
{ ssr: false, loading: () => <SkeletonPage /> },
);