import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:gifunavi/widgets/GameState/Colors.dart';

class GameStatusIndicator extends StatelessWidget {
  final bool gameStarted;
  final bool minimized;

  const GameStatusIndicator(
      {super.key, required this.gameStarted, this.minimized = true});

  @override
  Widget build(BuildContext context) {
    // Icons to show based on the game status
    IconData iconData =
        gameStarted ? Icons.stop_circle : Icons.play_circle_filled;
    // Text to show based on the game status
    String text = gameStarted ? 'in_game'.tr : 'start_game'.tr;

    // Layout for minimized view
    if (minimized) {
      return Container(
        height: 40, // Square size
        width: 40, // Square size
        decoration: BoxDecoration(
          color:
              gameStarted ? JapaneseColors.indigo : JapaneseColors.sakuraPink,
          shape: BoxShape
              .circle, // Making it circle when minimized for a more distinct look
        ),
        child: Icon(iconData, color: Colors.white),
      );
    }

    // Layout for expanded view
    return Container(
      padding: const EdgeInsets.all(12),
      decoration: BoxDecoration(
        color: gameStarted ? JapaneseColors.indigo : JapaneseColors.sakuraPink,
        borderRadius: BorderRadius.circular(10),
      ),
      child: Row(
        mainAxisSize: MainAxisSize.min,
        children: [
          Icon(iconData, color: Colors.white),
          const SizedBox(width: 8),
          Text(
            text,
            style: const TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
          ),
        ],
      ),
    );
  }
}
