import {defaultHeaderStyle} from '@caj/configs/colors';
import {SlideFromRightView} from '@caj/helper/animations';
import {RootState} from '@caj/redux/store';
import {
  createNativeStackNavigator,
  NativeStackNavigationProp,
} from '@react-navigation/native-stack';
import {Text} from 'native-base';
import {useSelector} from 'react-redux';

export type ChatMainStackNavigatorParamList = {
  Overview: undefined;
};

const ChatStack = createNativeStackNavigator<ChatMainStackNavigatorParamList>();

export type ChatScreenNavigationProp =
  NativeStackNavigationProp<ChatMainStackNavigatorParamList>;

function ChatScreenStack() {
  const lang = useSelector((state: RootState) => state.appVariables.lang);
  const theme = useSelector(
    (state: RootState) => state.appVariables.preferences.theme,
  );

  return (
    <ChatStack.Navigator>
      <ChatStack.Screen
        name="Overview"
        options={{
          title: '',
          animation: 'fade',
          headerShown: true,
          ...defaultHeaderStyle(theme),
        }}
        component={ChatMainScreen}
      />
    </ChatStack.Navigator>
  );
}

function ChatMainScreen() {
  const chatId = useSelector(
    (state: RootState) => state.nonSaveVariables.selectedChat,
  );

  return <Text>{chatId}</Text>;
}

export default ChatScreenStack;
