import { useState } from 'react';
import { PATHS } from '@/shared/constants/paths';
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
import { AccountTab } from '@/entities/account/ui/account-tab';
import { UserManageWrap } from '@/entities/account/ui/user-manage-wrap';
import { AccountTabKeys } from '@/entities/account/model/types';
import { FooterItemActiveKey } from '@/entities/common/model/types';
import { HeaderType } from '@/entities/common/model/types';
import { 
	useSetHeaderTitle,
	useSetHeaderType,
	useSetFooterMode,
  useSetFooterCurrentPage,
  useSetOnBack
} from '@/widgets/sub-layout/use-sub-layout';

export const UserManagePage = () => {
  const { navigate } = useNavigate();

  const [activeTab, setActiveTab] = useState<AccountTabKeys>(AccountTabKeys.UserManage);
  useSetHeaderTitle('계정 관리');
  useSetHeaderType(HeaderType.LeftArrow);
  useSetFooterMode(true);
  useSetFooterCurrentPage(FooterItemActiveKey.Account);
  useSetOnBack(() => {
    navigate(PATHS.home);
  });

  return (
    <>
      <main>
        <div className="tab-content">
          <div className="tab-pane pt-46 active">
            <AccountTab activeTab={ activeTab }></AccountTab>
            <UserManageWrap></UserManageWrap>
          </div>
        </div>
      </main>
    </>
  );
};