import 'package:flutter/material.dart';
import 'package:vnoteapp/pages/check/widgets/exam_device_connect_status/connect.dart';
import 'package:vnoteapp/pages/check/widgets/exam_device_connect_status/connect_disconnected.dart';
import 'package:vnoteapp/pages/check/widgets/exam_device_connect_status/connect_fail.dart';
import 'package:vnoteapp/pages/check/widgets/exam_device_connect_status/connect_success.dart';
import 'package:vnoteapp/pages/medical/models/worker.dart';

class DeviceStatus extends StatelessWidget {
  const DeviceStatus({
    super.key,
    required this.connectStatus,
  });
  final WorkerStatus connectStatus;

  @override
  Widget build(BuildContext context) {
    return _buildContent();
  }

  Widget _buildContent() {
    switch (connectStatus) {
      case WorkerStatus.connectionFailed:
        return const DeviceConnectFail();
      case WorkerStatus.connected:
        return const DeviceConnectSuccess();
      case WorkerStatus.connecting:
        return const DeviceConnect();
      case WorkerStatus.disconnected:
        return const DeviceConnectDisconnected();
      default:
        return const SizedBox();
    }
  }
}
