import React, { useState } from 'react';
import { View, Text, SafeAreaView, StyleSheet } from 'react-native';
import SearchScreen from '@/app/seach.tsx';
import BottomTabBar from '@/components/BottomTabBar';

export default function MainScreen() {
  const [tab, setTab] = useState<'search' | 'favorites' | 'settings'>('search');

  const renderContent = () => {
    switch (tab) {
      case 'search':
        return <SearchScreen />;
      case 'favorites':
        return <Text>⭐ 즐겨찾기 화면</Text>;
      case 'settings':
        return <Text>👤 내 설정 화면</Text>;
    }
  };

  return (
    <SafeAreaView style={styles.container}>
      <View style={styles.content}>{renderContent()}</View>
      <BottomTabBar activeTab={tab} onTabChange={setTab} />
    </SafeAreaView>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
  },
  content: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
});
