import 'package:doctor_app_flutter/core/model/SOAP/assessment/audit_diagnosis.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/assessment/widget/audit_item.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';

class AuditListBottomSheet extends StatelessWidget {
  final List<AuditDiagnosis> auditList;

  const AuditListBottomSheet({super.key, required this.auditList});

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      height: (auditList.length>1)?MediaQuery.sizeOf(context).height*.41:MediaQuery.sizeOf(context).height*.28,
      child: Material(
        color: Color(0xFFF7F7F7),
        shape: RoundedRectangleBorder(borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20))),
        child: Padding(
          padding: const EdgeInsets.symmetric(horizontal: 20.0, vertical: 32),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              AppText(
                TranslationBase.of(context).audit,
                fontWeight: FontWeight.w700,
                fontSize: 24,
                color: Color(0xFF2B353E),
              ),
              SizedBox(
                height: 16,
              ),
              SizedBox(
                height: (auditList.length>1)?MediaQuery.sizeOf(context).height*.25:MediaQuery.sizeOf(context).height*.12,
                child: Material(
                  shape: RoundedRectangleBorder(
                      borderRadius: BorderRadius.circular(10)),
                  color: Colors.white,
                  child: Column(
                    mainAxisSize: MainAxisSize.max,
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      Expanded(
                          child: ListView.separated(

                        itemCount: auditList.length,
                        itemBuilder: (context, index) => AuditItem(
                          auditDiagnosis: auditList[index],
                        ),
                        separatorBuilder: (_, __) => Divider(),
                      ))
                    ],
                  ),
                ),
              )
            ],
          ),
        ),
      ),
    );
  }
}
