import React from 'react';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { LeadsScreen, LeadDetailsScreen } from '@features';
import { route, RouteParams } from '@utils';
import { useTheme } from '@theme';

export type LeadsStackParamList = Pick<RouteParams, 'leads' | 'leadDetails'>;

const Stack = createNativeStackNavigator<LeadsStackParamList>();

export const LeadsStack = () => {
  const { theme: colors } = useTheme();

  return (
    <Stack.Navigator
      screenOptions={{
        headerStyle: {
          backgroundColor: colors.header,
        },
        headerTitleStyle: {
          fontSize: 16,
          fontWeight: '700',
          color: colors.text,
        },
        headerTitleAlign: 'center',
        headerTintColor: colors.text,
      }}>
      <Stack.Screen
        name={route.leads}
        component={LeadsScreen}
        options={{ headerTitle: 'Leads' }}
      />
      <Stack.Screen
        name={route.leadDetails}
        component={LeadDetailsScreen}
        options={{ headerTitle: 'Lead Details' }}
      />
    </Stack.Navigator>
  );
};
