260127_01_ENH: 커스텀 컴포넌트들 1차 완성 및 일부페이지에 SampleData 적용
This commit is contained in:
@@ -2,16 +2,17 @@
|
||||
|
||||
import {ReactNode, useState} from "react";
|
||||
import { usePathname, useRouter } from "next/navigation";
|
||||
import {topMenus, totalSubMenus, categorySubMenus} from "@/config/menu.data";
|
||||
import Header from "./Header";
|
||||
import SubMenu from "./SubMenu";
|
||||
import TotalFilter from "@/components/layout/TotalFilter";
|
||||
import CategoryFilter, {CategoryFilterValue} from "@/components/layout/CategoryFilter";
|
||||
import {cn} from "@/lib/utils";
|
||||
import {Button} from "@/components/ui/button";
|
||||
import {SelectedMap} from "@/types/common";
|
||||
import {topMenus, totalSubMenus, categorySubMenus} from "@/config/menu.data";
|
||||
import {categoryTarget, totalFilters} from "@/config/filter.data";
|
||||
import {CategoryTargetData, CategoryTargetType} from "@/config/filter.types";
|
||||
import Header from "./Header";
|
||||
import SubMenu from "./SubMenu";
|
||||
import TotalFilter from "./TotalFilter";
|
||||
import CategoryFilter, {CategoryFilterValue} from "./CategoryFilter";
|
||||
import ExcelDownloadButton from "./ExcelDownloadButton";
|
||||
import {LayoutFilterProvider} from "./LayoutFilterContext";
|
||||
|
||||
type MainLayoutProps = {
|
||||
children: ReactNode;
|
||||
@@ -64,13 +65,15 @@ const MainLayout = ({ children }: MainLayoutProps) => {
|
||||
else setIsCategoryFilterOpen((v) => !v);
|
||||
};
|
||||
|
||||
const handleExcelDownload = async () => {
|
||||
// TODO: 다운로드 구현 필요
|
||||
console.log("Excel download:", { pathname, top: activeTop.id, sub: activeSub.id });
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="min-h-screen flex flex-col bg-transparent">
|
||||
<LayoutFilterProvider
|
||||
value={{
|
||||
isTotal,
|
||||
totalValue,
|
||||
categoryValue,
|
||||
}}
|
||||
>
|
||||
<Header
|
||||
activeTopId={activeTop.id}
|
||||
onNavigate={movePage}
|
||||
@@ -95,12 +98,7 @@ const MainLayout = ({ children }: MainLayoutProps) => {
|
||||
필터 <span className="text-sm leading-none">{isFilterOpen ? "▲" : "▼"}</span>
|
||||
</button>
|
||||
|
||||
<Button
|
||||
variant="excel"
|
||||
className="h-8 px-3 text-sm font-semibold content-text-sm"
|
||||
onClick={handleExcelDownload}>
|
||||
Excel 다운로드
|
||||
</Button>
|
||||
<ExcelDownloadButton/>
|
||||
</div>
|
||||
|
||||
{isFilterOpen && (
|
||||
@@ -113,13 +111,15 @@ const MainLayout = ({ children }: MainLayoutProps) => {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* ✅ 실제 콘텐츠만 스크롤 */}
|
||||
<div className="flex-1 min-h-0 overflow-auto">
|
||||
<div className="p-3">{children}</div>
|
||||
<div className="p-3">
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</LayoutFilterProvider>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user