import 'package:flutter/material.dart';
import '../../../providers/battle_provider.dart';
import '../../../game/config/theme_config.dart';

class RestUI extends StatelessWidget {
  final BattleProvider battleProvider;

  const RestUI({super.key, required this.battleProvider});

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          const Icon(Icons.local_hotel, size: 64, color: ThemeConfig.btnRestBg),
          const SizedBox(height: 16),
          const Text("Rest Area", style: TextStyle(fontSize: 24, color: ThemeConfig.textColorWhite)),
          const SizedBox(height: 8),
          const Text("Take a breath and heal.", style: TextStyle(color: ThemeConfig.textColorWhite)),
          const SizedBox(height: 32),
          ElevatedButton(
            onPressed: () {
              // Use GameConfig for heal amount if possible, or keep hardcoded for now?
              // Let's use GameConfig.stageHealRatio * 2 or fixed 20?
              // Previous logic was hardcoded 20. Let's keep it simple for now or use a better logic.
              // "Rest & Leave (+20 HP)" -> Hardcoded in text too.
              battleProvider.player.heal(20);
              battleProvider.proceedToNextStage();
            },
            child: const Text("Rest & Leave (+20 HP)"),
          ),
        ],
      ),
    );
  }
}
