import { Stack } from 'expo-router';
import { StatusBar } from 'expo-status-bar';
import 'react-native-reanimated';

import { AuthProvider } from '@/src/providers/auth-provider';

export default function RootLayout() {
  return (
    <AuthProvider>
      <Stack>
        <Stack.Screen name="index" options={{ headerShown: false }} />
        <Stack.Screen name="login" options={{ title: 'Login', headerBackVisible: false }} />
        <Stack.Screen name="tenant-select" options={{ title: 'Tenant auswählen', headerBackVisible: false }} />
        <Stack.Screen name="(tabs)" options={{ headerShown: false }} />
        <Stack.Screen
          name="project/[id]"
          options={{
            title: 'Projekt',
            headerBackButtonDisplayMode: 'minimal',
            headerBackTitle: '',
            headerTintColor: '#111827',
          }}
        />
        <Stack.Screen
          name="more/account"
          options={{
            title: 'Konto',
            headerBackButtonDisplayMode: 'minimal',
            headerBackTitle: '',
            headerTintColor: '#111827',
          }}
        />
        <Stack.Screen
          name="more/settings"
          options={{
            title: 'Einstellungen',
            headerBackButtonDisplayMode: 'minimal',
            headerBackTitle: '',
            headerTintColor: '#111827',
          }}
        />
        <Stack.Screen
          name="more/wiki"
          options={{
            title: 'Wiki',
            headerBackButtonDisplayMode: 'minimal',
            headerBackTitle: '',
            headerTintColor: '#111827',
          }}
        />
        <Stack.Screen
          name="more/customers"
          options={{
            title: 'Kunden',
            headerBackButtonDisplayMode: 'minimal',
            headerBackTitle: '',
            headerTintColor: '#111827',
          }}
        />
        <Stack.Screen
          name="more/customer/[id]"
          options={{
            title: 'Kunde',
            headerBackButtonDisplayMode: 'minimal',
            headerBackTitle: '',
            headerTintColor: '#111827',
          }}
        />
        <Stack.Screen
          name="more/plants"
          options={{
            title: 'Objekte',
            headerBackButtonDisplayMode: 'minimal',
            headerBackTitle: '',
            headerTintColor: '#111827',
          }}
        />
        <Stack.Screen
          name="more/plant/[id]"
          options={{
            title: 'Objekt',
            headerBackButtonDisplayMode: 'minimal',
            headerBackTitle: '',
            headerTintColor: '#111827',
          }}
        />
        <Stack.Screen
          name="more/inventory"
          options={{
            title: 'Kundeninventar',
            headerBackButtonDisplayMode: 'minimal',
            headerBackTitle: '',
            headerTintColor: '#111827',
          }}
        />
        <Stack.Screen
          name="more/nimbot"
          options={{
            title: 'Nimbot M2',
            headerBackButtonDisplayMode: 'minimal',
            headerBackTitle: '',
            headerTintColor: '#111827',
          }}
        />
      </Stack>
      <StatusBar style="dark" />
    </AuthProvider>
  );
}
