import 'package:flutter/material.dart';
import 'package:syncrow_web/pages/device_managment/curtain_module/widgets/accurate_dialog_widget.dart';
import 'package:syncrow_web/pages/device_managment/curtain_module/widgets/normal_text_body_for_dialog.dart';
import 'package:syncrow_web/pages/device_managment/curtain_module/widgets/quick_calibrating_dialog.dart';
import 'package:syncrow_web/utils/color_manager.dart';

class QuickCalibrationDialog extends StatelessWidget {
  final int timControl;
  final String deviceId;
  final BuildContext parentContext;
  const QuickCalibrationDialog({
    super.key,
    required this.timControl,
    required this.deviceId,
    required this.parentContext,
  });

  @override
  Widget build(_) {
    return AlertDialog(
      backgroundColor: ColorsManager.whiteColors,
      contentPadding: EdgeInsets.zero,
      content: AccurateDialogWidget(
        title: 'Quick Calibration',
        body: const NormalTextBodyForDialog(
          title: 'Prepare Calibration:',
          step1:
              'Confirm that the curtain is in the fully closed and suspended state.',
          step2: 'click Next to Start calibration.',
        ),
        leftOnTap: () => Navigator.of(parentContext).pop(),
        rightOnTap: () {
          Navigator.of(parentContext).pop();
          showDialog(
            context: parentContext,
            builder: (_) => QuickCalibratingDialog(
              timControl: timControl,
              deviceId: deviceId,
              parentContext: parentContext,
            ),
          );
        },
      ),
    );
  }
}
