import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:syncrow_web/pages/device_managment/ac/view/ac_device_control.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/devices_model.dart';
import 'package:syncrow_web/pages/device_managment/ceiling_sensor/view/ceiling_sensor_controls.dart';
import 'package:syncrow_web/pages/device_managment/curtain/view/curtain_status_view.dart';
import 'package:syncrow_web/pages/device_managment/door_lock/view/door_lock_status_view.dart';
import 'package:syncrow_web/pages/device_managment/gateway/view/gateway_view.dart';
import 'package:syncrow_web/pages/device_managment/three_gang_switch/view/living_room_device_control.dart';
import 'package:syncrow_web/pages/device_managment/wall_sensor/view/wall_sensor_conrtols.dart';

mixin RouteControlsBasedCode {
  Widget routeControlsWidgets({required AllDevicesModel device}) {
    switch (device.productType) {
      case '3G':
        return LivingRoomDeviceControl(
          deviceId: device.uuid!,
        );
      case 'GW':
        return GateWayControls(
          gatewayId: device.uuid!,
        );
      case 'DL':
        return DoorLockView(device: device);
      case 'WPS':
        return WallSensorControls(device: device);
      case 'CPS':
        return CeilingSensorControls(
          device: device,
        );
      case 'CUR':
        return CurtainStatusView(
          deviceId: device.uuid!,
        );
      case 'AC':
        return AcDeviceControl(device: device);
      default:
        return const SizedBox();
    }
  }
}
