import 'package:flutter/material.dart';
import 'package:gifunavi/widgets/GameState/CheckinState.dart';
import 'package:gifunavi/widgets/GameState/game_on_off.dart';

class DashboardWidget extends StatelessWidget {
  final bool gameStarted;
  final int locationsVisited;
  final bool isMinimized;

  const DashboardWidget({
    super.key,
    required this.gameStarted,
    required this.locationsVisited,
    this.isMinimized = false,
  });

  @override
  Widget build(BuildContext context) {
    List<Widget> widgets = [
      GameStatusIndicator(gameStarted: gameStarted, minimized: isMinimized),
      SizedBox(
          height: isMinimized ? 0 : 8, width: isMinimized ? 8 : 0), // Spacing
      LocationVisitedWidget(count: locationsVisited, minimized: isMinimized),
    ];

    return Container(
      padding: EdgeInsets.all(isMinimized ? 8 : 16),
      decoration: BoxDecoration(
        color: Colors.white,
        boxShadow: [
          BoxShadow(
            color: Colors.grey.withOpacity(0.5),
            spreadRadius: 5,
            blurRadius: 7,
            offset: const Offset(0, 3),
          ),
        ],
        borderRadius: BorderRadius.circular(10),
      ),
      child: isMinimized
          ? Row(
              mainAxisSize: MainAxisSize.min,
              children: widgets,
            )
          : Column(
              mainAxisSize: MainAxisSize.min,
              children: widgets,
            ),
    );
  }
}
