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/shared/batch_control/factory_reset.dart';
import 'package:syncrow_web/pages/device_managment/sos/bloc/sos_device_bloc.dart';

class SOSBatchControlView extends StatelessWidget {
  const SOSBatchControlView({
    super.key,
    required this.deviceIds,
  });

  final List<String> deviceIds;

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