import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/pharmacy_intervention_item.dart';
import 'package:doctor_app_flutter/screens/pharmacy_intervention/PharmacyIntervention.dart';
import 'package:doctor_app_flutter/screens/pharmacy_intervention/viewmodel/pharmacy_intervention_view_model.dart';
import 'package:doctor_app_flutter/screens/pharmacy_intervention/widgets/InterventionDetails.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:flutter/material.dart';

class InterventionCardBody extends StatelessWidget {
  final Medication medication;
  final PharmacyInterventionViewModel model;

  const InterventionCardBody(
      {super.key, required this.medication, required this.model});

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        SizedBox(
          height: 10,
        ),
        Row(
          children: [
            Expanded(
              child: InterventionDetails(
                title: TranslationBase
                    .of(context)
                    .accessLevel,
                data: medication.accessLevelDescription ?? '',
              ),
            ),
            Expanded(
                child: InterventionDetails(
                  title: TranslationBase
                      .of(context)
                      .patientID,
                  data: medication.patientID.toString() ?? '',
                ))
          ],
        ),
        SizedBox(
          height: 10,
        ),
        Row(
          children: [
            Expanded(
              child: InterventionDetails(
                title: TranslationBase
                    .of(context)
                    .patientName,
                data: medication.patientName.toString() ?? '',
              ),
            ),
            Expanded(
                child: InterventionDetails(
                  title: TranslationBase
                      .of(context)
                      .nursingStation,
                  data: medication.nursingStation.toString() ?? '',
                ))
          ],
        ),
        SizedBox(
          height: 10,
        ),
        Row(
          children: [
            Expanded(
              child: InterventionDetails(
                title: TranslationBase
                    .of(context)
                    .admissionNumber,
                data: medication.admissionNo.toString() ?? '',
              ),
            ),
            Expanded(
                child: InterventionDetails(
                  title: TranslationBase
                      .of(context)
                      .medication,
                  data: medication.medication.toString() ?? '',
                ))
          ],
        ),
        SizedBox(
          height: 10,
        ),
        Row(
          children: [
            Expanded(
              child: InterventionDetails(
                title: TranslationBase
                    .of(context)
                    .dosageDetails,
                data: medication.dosageDetail.toString() ?? '',
              ),
            ),
            Expanded(
                child: InterventionDetails(
                  title: TranslationBase
                      .of(context)
                      .doctorComments,
                  data: medication.doctorComments.toString() ?? '',
                ))
          ],
        ),
        SizedBox(
          height: 10,
        ),
        Row(
          children: [
            Expanded(
              child: InterventionDetails(
                title: TranslationBase
                    .of(context)
                    .startDate,
                data: model.getDate(medication.startDatetime.toString() ?? ''),
              ),
            ),
            Expanded(
                child: InterventionDetails(
                  title: TranslationBase
                      .of(context)
                      .stopDate,
                  data: model.getDate(medication.stopDatetime.toString() ?? ''),
                ))
          ],
        ),
        SizedBox(
          height: 10,
        ),
        Row(
          children: [
            Expanded(
              child: InterventionDetails(
                title: TranslationBase
                    .of(context)
                    .status,
                data: medication.statusName ?? '',
              ),
            ),
            Expanded(
                child: InterventionDetails(
                  title: TranslationBase
                      .of(context)
                      .doctor,
                  data: medication.doctorName.toString() ?? '',
                ))
          ],
        ),
        SizedBox(
          height: 10,
        ),
        Row(
          mainAxisSize: MainAxisSize.max,
          mainAxisAlignment: MainAxisAlignment.start,
          children: [
            Expanded(
              child: InterventionDetails(
                title: TranslationBase
                    .of(context)
                    .pharmacyRemarks,
                data: medication.pharmacyRemarks.toString() ?? '-',
              ),
            ),
            Expanded(child: SizedBox.shrink())
          ],
        ),
        SizedBox(
          height: 10,
        ),
      ],
    );
  }
}
