import 'package:fis_i18n/i18n.dart';
import 'package:fis_ui/base_define/page.dart';
import 'package:fis_ui/index.dart';
import 'package:flutter/material.dart';
import 'package:flyinsono/architecture/define.dart';
import 'package:flyinsono/pages/remedical/consultation_record_view/controller.dart';
import 'package:flyinsono/pages/remedical/consultation_record_view/widgets/record_patient_refer_widget.dart';

class RecordReferDoctorDiaLog
    extends FisView<ConsultationRecordViewController> {
  const RecordReferDoctorDiaLog({
    Key? key,
    required this.patientName,
  }) : super(key: key);

  final String patientName;

  @override
  FWidget build(BuildContext context) {
    return FSimpleDialog(
      title: FText(
        i18nBook.remedical.transfer.t,
        style: TextStyle(
          color: Colors.white,
          fontSize: 18,
        ),
      ),
      onClose: () {
        controller.initReferStatus();
      },
      okString: i18nBook.common.confirm.t,
      cancelString: i18nBook.common.cancel.t,
      children: [
        FContainer(
          width: 700,
          child: FContainer(
            child: FColumn(
              children: [
                DesktopPatientRefer(
                  patientName: patientName,
                ),
              ],
            ),
          ),
        ),
      ],
    );
  }
}

/// pc端病人转诊页面
// ignore: must_be_immutable
class DesktopPatientRefer extends FStatefulWidget implements FPage {
  DesktopPatientRefer({
    Key? key,
    required this.patientName,
    this.pageName = 'DesktopPatientRefer',
  }) : super(key: key);

  final String patientName;
  @override
  final String pageName;

  @override
  FState<DesktopPatientRefer> createState() => _DesktopPatientReferState();
}

class _DesktopPatientReferState extends FState<DesktopPatientRefer> {
  @override
  FWidget build(BuildContext context) {
    return FContainer(
      height: 600,
      child: _buildScannedImageDialog(),
    );
  }

  FWidget _buildScannedImageDialog() {
    return RecordReferralApplication(widget.patientName);
  }
}
