import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:smart_hotel_app/views/home/abnormal/cubit/abnormal_state.dart';

class TemperatureBlock extends StatelessWidget {
  final AlarmInfo alarmInfo;

  const TemperatureBlock({super.key, required this.alarmInfo});

  @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(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Container(
            width: 64.w,
            height: 66.h,
            decoration: BoxDecoration(
              color: Color.fromRGBO(219, 234, 254, 1),
              borderRadius: BorderRadius.circular(15.r),
            ),
            child: Icon(
              Icons.thermostat_outlined,
              color: Color.fromRGBO(59, 130, 246, 1),
              size: 35.sp,
            ),
          ),
          SizedBox(width: 15.w),
          Expanded(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  alarmInfo.alarmType,
                  style: TextStyle(
                    fontSize: 28.sp,
                    color: Colors.black,
                    fontWeight: FontWeight.bold,
                  ),
                ),
                SizedBox(height: 8.h),
                Text(
                  alarmInfo.deviceInfo,
                  style: TextStyle(
                    fontSize: 24.sp,
                    color: Color.fromRGBO(100, 116, 139, 1),
                  ),
                ),
                SizedBox(height: 15.h),
                Row(
                  children: [
                    Text(
                      '${alarmInfo.alarmLevel}·',
                      style: TextStyle(
                        fontSize: 24.sp,
                        color: Color.fromRGBO(255, 100, 101, 1),
                        fontWeight: FontWeight.bold,
                      ),
                    ),
                    Container(
                      padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 5.h),
                      decoration: BoxDecoration(
                        color: Color.fromRGBO(255, 158, 159, 0.5),
                        borderRadius: BorderRadius.circular(16.r),
                      ),
                      child: Text(
                        alarmInfo.urgency,
                        style: TextStyle(
                          fontSize: 24.sp,
                          color: Color.fromRGBO(255, 100, 101, 1),
                        ),
                      ),
                    ),
                  ],
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}