import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/factory_reset_model.dart';
import 'package:syncrow_web/pages/device_managment/door_lock/bloc/door_lock_bloc.dart';
import 'package:syncrow_web/pages/device_managment/door_lock/bloc/door_lock_event.dart';
import 'package:syncrow_web/pages/device_managment/shared/batch_control/factory_reset.dart';
// import 'package:syncrow_web/pages/device_managment/shared/batch_control/firmware_update.dart';
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';

class DoorLockBatchControlView extends StatelessWidget with HelperResponsiveLayout {
  const DoorLockBatchControlView({super.key, required this.devicesIds});

  final List<String> devicesIds;

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        // SizedBox(
        //   width: 170,
        //   height: 140,
        //   child: FirmwareUpdateWidget(
        //     deviceId: devicesIds.first,
        //     version: 12,
        //   ),
        // ),
        // const SizedBox(
        //   width: 12,
        // ),
        SizedBox(
          width: 170,
          height: 140,
          child: FactoryResetWidget(
            callFactoryReset: () {
              BlocProvider.of<DoorLockBloc>(context).add(
                DoorLockFactoryReset(
                  deviceId: devicesIds.first,
                  factoryReset: FactoryResetModel(devicesUuid: devicesIds),
                ),
              );
            },
          ),
        ),
      ],
    );
  }
}
