import 'package:fis_i18n/i18n.dart';
import 'package:fis_ui/index.dart';
import 'package:flutter/material.dart';
import 'package:flyinsono/architecture/define.dart';
import 'package:flyinsono/pages/main/home/widgets/dialog_page.dart';
import 'package:flyinsono/views/desktop/real_time_consultation/widgets/appointment_application.dart';
import 'package:flyinsono/views/desktop/real_time_consultation/widgets/main_content.dart';
import 'package:get/get.dart';

class ScheduleDetailDialog extends FisView {
  ScheduleDetailDialog({
    super.key,
    this.isDetailDialog = true,
  });

  /// TODO:[Gavin] 多语言-UI-整合
  final double _dialogWidth = i18nBook.isCurrentChinese ? 800.0 : 1200.0;

  /// 大列表页面不仅仅需要看详情
  final bool? isDetailDialog;

  @override
  FWidget build(BuildContext context) {
    return FOverlayContainer(
      child: FSimpleDialog(
          title: FText(
            i18nBook.notification.consultationRequestForm.t,
            style: TextStyle(
              color: Colors.white,
              fontSize: 18,
            ),
          ),
          okString: i18nBook.common.confirm.t,
          cancelString: i18nBook.common.cancel.t,
          children: [
            _buildPatientInfo(),
          ]),
    );
  }

  FWidget _buildScheduleDetail() {
    if (isDetailDialog!) {
      return FAppointmentApplicationDialog();
    } else {
      return FRealTimeConsultationMainContentView();
    }
    // return FAppointmentApplicationDialog();
  }

  FWidget _buildPatientInfo() {
    return FContainer(
      width: _dialogWidth,
      height: Get.height * 0.8,
      child: _buildScheduleDetail(),
    );
  }
}
