import 'package:flutter/material.dart';
import 'package:hl_lieferservice/feature/delivery/detail/model/note.dart';
import 'package:hl_lieferservice/feature/delivery/detail/presentation/note/note_list_item.dart';

class NoteList extends StatelessWidget {
  final List<NoteInformation> notes;
  final String deliveryId;

  const NoteList({super.key, required this.notes, required this.deliveryId});

  @override
  Widget build(BuildContext context) {
    if (notes.isEmpty) {
      return const Center(child: Text("keine Notizen vorhanden"));
    }

    return ListView.separated(
      shrinkWrap: true,
      physics: NeverScrollableScrollPhysics(),
      itemBuilder:
          (context, index) => NoteListItem(
            note: notes[index],
            deliveryId: deliveryId,
            index: index,
          ),
      separatorBuilder: (context, index) => const Divider(height: 0),
      itemCount: notes.length,
    );
  }
}
