import 'package:flutter/material.dart';
import '../../ui/widgets/structure_widgets.dart';
import '../../ui/widgets/nav_widgets.dart';
import 'today_screen.dart';
import 'decide_screen.dart';
import 'history_screen.dart';
import 'profile_screen.dart';

class MainShell extends StatefulWidget {
  const MainShell({super.key});

  @override
  State<MainShell> createState() => _MainShellState();
}

class _MainShellState extends State<MainShell> {
  int _currentIndex = 0;

  final List<Widget> _screens = const [
    TodayScreen(),
    DecideScreen(),
    HistoryScreen(),
    ProfileScreen(),
  ];

  @override
  Widget build(BuildContext context) {
    return AyuelScaffold(
      body: IndexedStack(index: _currentIndex, children: _screens),
      bottomNavigationBar: AyuelBottomNav(
        currentIndex: _currentIndex,
        onTap: (index) => setState(() => _currentIndex = index),
      ),
    );
  }
}
