import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import 'package:niogu_app/core/components/top_back_bar_app.dart';
import 'package:niogu_app/features/supplier/domain/entities/supplier.dart';
import 'package:niogu_app/features/supplier/presentation/widgets/supplier_activity.dart';
import 'package:sizer/sizer.dart';

class SupplierActivitesScreen extends ConsumerWidget {
  final List<SupplierActivities> activities;

  const SupplierActivitesScreen({super.key, required this.activities});

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    return LayoutBuilder(
      builder: (context, constraints) {        
        return SafeArea(
          top: false,
          bottom: true,
          right: false,
          left: false,
          child: Scaffold(
                backgroundColor: const Color(0xFFF9FAFB),
                appBar: TopBackBarApp(
                  title: "Aktivitas Dengan Pemasok",
                  onTap: () => context.pop(),
                ),
                body: ListView.builder(
                  padding: EdgeInsets.all(5.w),
                  itemCount: activities.length,
                  itemBuilder: (context, index) {
                    final activity = activities[index];
                    return SupplierActivity(activity: activity);
                  },
                ),
              ),
        );
      },
    );
  }
}
