import { createNativeStackNavigator } from '@react-navigation/native-stack';
import React from 'react';

import { DEFAULT_ROUTE_OPTIONS } from '../../../constants/settings';
import PersonDetailScreen from '../../../screens/personDetail/index';
import ProfileScreen from '../../../screens/profile/index';
import CongressScreen from '../../../screens/profile/screens/congress/index';
import CongressDetailScreen from '../../../screens/profile/screens/congress/screens/congressDetail/index';
import CongressCandidatesScreen from '../../../screens/profile/screens/congress/screens/congressDetail/screens/congressCandidates/index';
import CongressCandidateDetailScreen from '../../../screens/profile/screens/congress/screens/congressDetail/screens/congressCandidates/screens/congressCandidateDetail/index';
import CongressConclusionScreen from '../../../screens/profile/screens/congress/screens/congressDetail/screens/congressConclusion/index';
import CongressVoteScreen from '../../../screens/profile/screens/congress/screens/congressDetail/screens/congressVote/index';
import EducationScreen from '../../../screens/profile/screens/education/index';
import EducationApplicationScreen from '../../../screens/profile/screens/education/screens/educationApplication/index';
import EducationDetailScreen from '../../../screens/profile/screens/education/screens/educationDetail/index';
import EducationOtherDetailScreen from '../../../screens/profile/screens/education/screens/educationDetail/screens/educationOtherDetail/index';
import EducationImageScreen from '../../../screens/profile/screens/education/screens/educationDetail/screens/educationOtherDetail/screens/educationImage/index';
import EducationStatusScreen from '../../../screens/profile/screens/education/screens/educationDetail/screens/educationStatus/index';
import MessageListScreen from '../../../screens/profile/screens/messageList/index';
import MessageDetailScreen from '../../../screens/profile/screens/messageList/screens/messageDetail/index';
import UnitDetailScreen from '../../../screens/unit/screens/unitDetail/index';
import UnitFunctionsScreen from '../../../screens/unit/screens/unitFunctions/index';
import UnitInfoScreen from '../../../screens/unit/screens/unitInfo/index';
import UnitMembersScreen from '../../../screens/unit/screens/unitMembers/index';
import UnitRegistrationScreen from '../../../screens/unit/screens/unitRegistration/index';
import NavBar from '../../NavBar/NavBar';

export type ProfileStackParamList = {
  Profile: undefined;
  ProfileScreen: undefined;
  MessageList: undefined;
  MessageDetail: { id: string };
  Education: undefined;
  EducationApplication: { id: string; educationName: string };
  EducationDetail: {
    id: string;
    educationName: string;
    logo: string;
    reminderId: string;
    educationCourseId: string;
    hasNoAPiReminder?: boolean;
  };
  EducationOtherDetail: {
    educationName: string;
    id: string;
  };
  EducationStatus: {
    id: string;
    educationName: string;
  };
  EducationImage: {
    imageName: string;
    imageContent: string;
  };
  CongressDetail: { id: string; eventName: string };
  CongressCandidates: { id: string; eventName: string };
  CongressCandidateDetail: { id: string; photo: string };
  CongressVote: { id: string; eventName: string };
  CongressConclusion: { id: string; eventName: string };
  UnitDetail: { id: string };
  UnitInfo: { id: string };
  UnitFunctions: { id: string };
  UnitMembers: { id: string };
  UnitRegistration: { id: string };
  Congress: undefined;
  PersonDetail: { id: string; isFromCatalog: boolean };
};

const ProfileTab = createNativeStackNavigator<ProfileStackParamList>();

const ProfileStackScreen = () => {
  return (
    <ProfileTab.Navigator screenOptions={DEFAULT_ROUTE_OPTIONS}>
      <ProfileTab.Screen
        options={{
          headerTitle: () => {
            return <NavBar />;
          },
        }}
        name={'ProfileScreen'}
        component={ProfileScreen}
      />
      <ProfileTab.Screen
        options={{
          headerTitle: 'Všechny zprávy',
        }}
        name={'MessageList'}
        component={MessageListScreen}
      />
      <ProfileTab.Screen
        options={{
          headerTitle: 'Zpráva',
        }}
        name={'MessageDetail'}
        component={MessageDetailScreen}
      />
      <ProfileTab.Screen
        options={{
          headerTitle: 'Moje kurzy',
        }}
        name={'Education'}
        component={EducationScreen}
      />
      <ProfileTab.Screen name={'EducationApplication'} component={EducationApplicationScreen} />
      <ProfileTab.Screen name={'EducationDetail'} component={EducationDetailScreen} />
      <ProfileTab.Screen name={'EducationOtherDetail'} component={EducationOtherDetailScreen} />
      <ProfileTab.Screen name={'EducationStatus'} component={EducationStatusScreen} />
      <ProfileTab.Screen name={'EducationImage'} component={EducationImageScreen} />
      <ProfileTab.Screen name={'CongressDetail'} component={CongressDetailScreen} />
      <ProfileTab.Screen name={'CongressCandidates'} component={CongressCandidatesScreen} />
      <ProfileTab.Screen
        name={'CongressCandidateDetail'}
        options={{
          headerTitle: 'Kandidátní listina',
        }}
        component={CongressCandidateDetailScreen}
      />
      <ProfileTab.Screen name={'CongressVote'} component={CongressVoteScreen} />
      <ProfileTab.Screen name={'CongressConclusion'} component={CongressConclusionScreen} />
      <ProfileTab.Screen name={'UnitDetail'} component={UnitDetailScreen} />
      <ProfileTab.Screen name={'UnitInfo'} component={UnitInfoScreen} />
      <ProfileTab.Screen name={'UnitFunctions'} component={UnitFunctionsScreen} />
      <ProfileTab.Screen
        name={'UnitMembers'}
        options={{
          headerTitle: 'Členové jednotky',
        }}
        component={UnitMembersScreen}
      />

      <ProfileTab.Screen
        name={'UnitRegistration'}
        options={{
          headerTitle: 'Statistika registrace',
        }}
        component={UnitRegistrationScreen}
      />
      <ProfileTab.Screen
        options={{
          headerTitle: 'Sněmy',
        }}
        name={'Congress'}
        component={CongressScreen}
      />
      <ProfileTab.Screen
        options={{
          headerTitle: 'Detail osoby',
        }}
        name={'PersonDetail'}
        component={PersonDetailScreen}
      />
    </ProfileTab.Navigator>
  );
};

export default ProfileStackScreen;
