import { Stack } from 'expo-router';
import { useColorScheme } from 'react-native';
import { PaperProvider} from 'react-native-paper';
import { MD3LightTheme, MD3DarkTheme } from 'react-native-paper';


export default function RootLayout() {
  const colorScheme = useColorScheme();
  const theme = colorScheme === 'dark' ? MD3DarkTheme :
  MD3LightTheme;

  return (
    <PaperProvider theme={theme} >
        <Stack screenOptions={{
                headerStyle: {
                  backgroundColor: theme.colors.primaryContainer,
                  borderBottomWidth:0
                },
                headerTintColor: theme.colors.primary,
        }}>
          <Stack.Screen name="(tabs)" options={{ headerShown: false }} />
          <Stack.Screen 
          name="location/[id]" 
          options={{ 
            title: "Lokalizacja", 
            headerBackTitle: "Powrót",
          }}/>
        </Stack>
    </PaperProvider>
  );
}
