import { useState } from 'react';
import { PATHS } from '@/shared/constants/paths';
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
import { TaxTab } from '@/entities/tax/ui/tax-tab';
import { InvoiceListWrap } from '@/entities/tax/ui/invoice-list-wrap';
import { TaxTabKeys } from '@/entities/tax/model/types';
import { HeaderType } from '@/entities/common/model/types';
import { 
	useSetHeaderTitle,
	useSetHeaderType,
	useSetFooterMode,
  useSetOnBack
} from '@/widgets/sub-layout/use-sub-layout';

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

  const [activeTab, setActiveTab] = useState<TaxTabKeys>(TaxTabKeys.InvoiceList);
  useSetHeaderTitle('부가세 신고 자료');
  useSetHeaderType(HeaderType.LeftArrow);
  useSetFooterMode(true);
  useSetOnBack(() => {
    navigate(PATHS.home);
  });

  return (
    <>
      <main>
        <div className="tab-content">
          <div className="tab-pane sub active">
            <TaxTab activeTab={ activeTab }></TaxTab>
            <InvoiceListWrap></InvoiceListWrap>
          </div>
        </div>
      </main>
    </>
  );
};