import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class ServiceStatsBlock extends StatelessWidget {
  final int pendingCount;
  final int occupiedCount;
  final int vacantCount;

  const ServiceStatsBlock({
    super.key,
    required this.pendingCount,
    required this.occupiedCount,
    required this.vacantCount,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
      decoration: BoxDecoration(
        // borderRadius: BorderRadius.circular(24.r),
        color: Color.fromRGBO(242, 243, 245, 1.0),
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          // Text(
          //   '服务概览',
          //   style: TextStyle(
          //     fontSize: 28.sp,
          //     fontWeight: FontWeight.bold,
          //     color: const Color.fromRGBO(31, 41, 55, 1),
          //   ),
          // ),
          // SizedBox(height: 20.h),
          Row(
            children: [
              _buildStatCard(
                '待响应需求',
                '$pendingCount',
                const Color.fromRGBO(239, 68, 68, 1),
                Icons.warning_amber_rounded,
              ),
              SizedBox(width: 12.w),
              _buildStatCard(
                '入住中',
                '$occupiedCount',
                const Color.fromRGBO(34, 197, 94, 1),
                Icons.meeting_room_outlined,
              ),
              SizedBox(width: 12.w),
              _buildStatCard(
                '空闲可清洁',
                '$vacantCount',
                const Color.fromRGBO(59, 130, 246, 1),
                Icons.cleaning_services_outlined,
              ),
            ],
          ),
        ],
      ),
    );
  }

  Widget _buildStatCard(
      String label, String value, Color color, IconData icon) {
    return Expanded(
      child: Container(
        padding: EdgeInsets.all(16.w),
        decoration: BoxDecoration(
          color: color.withOpacity(0.08),
          borderRadius: BorderRadius.circular(16.r),
        ),
        child: Column(
          children: [
            // Icon(icon, color: color, size: 28.sp),
            SizedBox(height: 8.h),
            Text(
              value,
              style: TextStyle(
                fontSize: 60.sp,
                fontWeight: FontWeight.bold,
                color: color,
              ),
            ),
            SizedBox(height: 4.h),
            Text(
              label,
              style: TextStyle(
                fontSize: 24.sp,
                color: const Color.fromRGBO(107, 114, 128, 1),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
