import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/progress_note.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/plan/widget/ProgressNoteItem.dart';
import 'package:flutter/material.dart';

class ListOfNotes extends StatelessWidget {
  final List<ProgressNote> notes;
  final SOAPViewModel model;

  const ListOfNotes({super.key, required this.notes, required this.model});

  @override
  Widget build(BuildContext context) => Flexible(
        child: ListView.separated(
            physics: NeverScrollableScrollPhysics(),
            shrinkWrap: true,
            itemBuilder: (_, index) => ProgressNoteItem(
                  type: notes[index].progressNotesTypesName ?? '',
                  speciality: notes[index].specialityName ?? '',
                  Notes: notes[index].progressNote ?? '',
                  patientCondition: model.getPatientConditionValue(
                          notes[index].patientCondition ?? '') ??
                      '',
                  doctorName: notes[index].userFullName ?? '',
                  modifiedOn: notes[index].modifiedOn ?? '',
                ),
            separatorBuilder: (_, __) => Divider(),
            itemCount: notes.length),
      );
}
