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),
      child: Row(
        spacing: 20.w,
        children: [
          _buildStatCard(
            '待响应',
            '$pendingCount',
            const Color.fromRGBO(73, 149, 234, 1),
          ),
          _buildStatCard(
            '入住中',
            '$occupiedCount',
            const Color.fromRGBO(20, 184, 166, 1),
          ),
          _buildStatCard(
            '空闲可清洁',
            '$vacantCount',
            const Color.fromRGBO(10, 13, 20, 1),
          ),
        ],
      ),
    );
  }

  Widget _buildStatCard(String label, String value, Color color) {
    return Expanded(
      child: Container(
        height: 112.h,
        decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.circular(24.r),
        ),
        child: Column(
          children: [
            Text(
              value,
              style: TextStyle(
                fontSize: 60.sp,
                fontWeight: FontWeight.bold,
                color: color,
              ),
            ),
            Text(
              label,
              style: TextStyle(
                fontSize: 24.sp,
                color: const Color.fromRGBO(100, 116, 139, 1),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
