import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:smart_hotel_app/views/report/room/cubit/room_report_state.dart';

class StatusStats extends StatelessWidget {
  final List<StatusStat> stats;

  const StatusStats({super.key, required this.stats});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      padding: EdgeInsets.all(28.w),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(24.r),
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: stats.map((stat) => StatItem(stat: stat)).toList(),
      ),
    );
  }
}

class StatItem extends StatelessWidget {
  final StatusStat stat;

  const StatItem({super.key, required this.stat});

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Text(
          stat.count.toString(),
          style: TextStyle(
            fontSize: 40.sp,
            fontWeight: FontWeight.bold,
            color: stat.color,
          ),
        ),
        SizedBox(height: 4.h),
        Text(
          stat.label,
          style: TextStyle(
            fontSize: 24.sp,
            color: const Color.fromRGBO(156, 163, 175, 1),
          ),
        ),
      ],
    );
  }
}
