26 lines
730 B
React
26 lines
730 B
React
|
|
/**
|
||
|
|
* AdminLayout 컴포넌트
|
||
|
|
* 모든 Admin 페이지에서 공통으로 사용하는 레이아웃
|
||
|
|
* 헤더 고정 + 본문 스크롤 구조
|
||
|
|
*/
|
||
|
|
import { useLocation } from 'react-router-dom';
|
||
|
|
import Header from './Header';
|
||
|
|
|
||
|
|
function AdminLayout({ user, children }) {
|
||
|
|
const location = useLocation();
|
||
|
|
|
||
|
|
// 일정 관리 페이지는 내부 스크롤 처리
|
||
|
|
const isSchedulePage = location.pathname.includes('/admin/schedules');
|
||
|
|
|
||
|
|
return (
|
||
|
|
<div className="h-screen overflow-hidden flex flex-col bg-gray-50">
|
||
|
|
<Header user={user} />
|
||
|
|
<main className={`flex-1 min-h-0 ${isSchedulePage ? 'overflow-hidden' : 'overflow-y-auto'}`}>
|
||
|
|
{children}
|
||
|
|
</main>
|
||
|
|
</div>
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
export default AdminLayout;
|