import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:smart_hotel_app/views/home/device/cubit/device_state.dart';

class StateInfoBlock extends StatelessWidget {
  final DeviceInfo deviceInfo;

  const StateInfoBlock({super.key, required this.deviceInfo});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      margin: EdgeInsets.only(top: 10.h),
      padding: EdgeInsets.all(25.w),
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(25.r),
        color: Colors.white,
      ),
      child: Row(
        children: [
          Container(
            width: 70.w,
            height: 70.h,
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(15.r),
              color: Color.fromRGBO(219, 234, 254, 1),
            ),
            child: Icon(
              Icons.power,
              color: Color.fromRGBO(59, 130, 246, 1),
              size: 32.sp,
            ),
          ),
          SizedBox(width: 15.w),
          Expanded(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  deviceInfo.deviceName,
                  style: TextStyle(
                    fontSize: 28.sp,
                    color: Colors.black,
                    fontWeight: FontWeight.bold,
                  ),
                ),
                SizedBox(height: 8.h),
                Text(
                  '${deviceInfo.deviceId}·位置: ${deviceInfo.location}',
                  style: TextStyle(
                    fontSize: 24.sp,
                    color: Color.fromRGBO(100, 116, 139, 1),
                  ),
                ),
              ],
            ),
          ),
          Text(
            deviceInfo.status,
            style: TextStyle(
              fontSize: 24.sp,
              color: Color.fromRGBO(20, 184, 166, 1),
              fontWeight: FontWeight.bold,
            ),
          ),
        ],
      ),
    );
  }
}