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

import { DEFAULT_ROUTE_OPTIONS } from '../../../constants/settings';
import MoreScreen from '../../../screens/more/index';
import PersonDetailScreen from '../../../screens/personDetail/index';
import NavBar from '../../NavBar/NavBar';

export type MoreStackParamList = {
  MoreScreen: undefined;
  PersonDetail: { id: string; isFromCatalog: boolean };
};

const MoreTab = createNativeStackNavigator<MoreStackParamList>();

const MoreStackScreen = () => (
  <MoreTab.Navigator screenOptions={DEFAULT_ROUTE_OPTIONS}>
    <MoreTab.Screen
      options={{
        headerTitle: () => {
          return <NavBar />;
        },
      }}
      name={'MoreScreen'}
      component={MoreScreen}
    />
    <MoreTab.Screen
      options={{
        headerTitle: 'Detail osoby',
      }}
      name={'PersonDetail'}
      component={PersonDetailScreen}
    />
  </MoreTab.Navigator>
);

export default MoreStackScreen;
