import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { PATHS } from '@/shared/constants/paths';
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
import { SettlementAgencyTab } from '@/entities/additional-service/ui/settlement-agency/settlement-agency-tab';
import { SettlementAgencyManageWrap } from '@/entities/additional-service/ui/settlement-agency/settlement-agency-manage-wrap';
import { SettlementAgencyTabKeys } from '@/entities/additional-service/model/types';
import { HeaderType } from '@/entities/common/model/types';
import {
	useSetHeaderTitle,
	useSetHeaderType,
	useSetFooterMode,
  useSetOnBack
} from '@/widgets/sub-layout/use-sub-layout';

export const SettlementAgencyManagePage = () => {
  const { t } = useTranslation();
  const { navigate } = useNavigate();

  const [activeTab, setActiveTab] = useState<SettlementAgencyTabKeys>(SettlementAgencyTabKeys.Manage);

  useSetHeaderTitle(t('additionalService.settlementAgency.title'));
  useSetHeaderType(HeaderType.LeftArrow);
  useSetFooterMode(false);
  useSetOnBack(() => {
    navigate(PATHS.home);
  });

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