// lib/screens/marine/manual/reports/marine_manual_npe_report_hub.dart

import 'package:flutter/material.dart';
import 'npe_report_from_in_situ.dart';
import 'npe_report_from_tarball.dart';
import 'npe_report_new_location.dart';

class MarineManualNPEReportHub extends StatelessWidget {
  const MarineManualNPEReportHub({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("Create NPE Report"),
      ),
      body: ListView(
        padding: const EdgeInsets.all(16.0),
        children: [
          _buildOptionCard(
            context: context,
            icon: Icons.sync_alt,
            title: 'From Recent In-Situ Sample',
            subtitle: 'Use information & data from a recent in-situ sampling event .',
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => const NPEReportFromInSitu()),
              );
            },
          ),
          _buildOptionCard(
            context: context,
            icon: Icons.public,
            title: 'From Recent Tarball Station',
            subtitle: 'Use information from a recent tarball sampling event.',
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => const NPEReportFromTarball()),
              );
            },
          ),
          _buildOptionCard(
            context: context,
            icon: Icons.add_location_alt_outlined,
            title: 'For a New Location',
            subtitle: 'Manually enter location details for a new pollution observation.',
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => const NPEReportNewLocation()),
              );
            },
          ),
        ],
      ),
    );
  }

  Widget _buildOptionCard({
    required BuildContext context,
    required IconData icon,
    required String title,
    required String subtitle,
    required VoidCallback onTap,
  }) {
    return Card(
      elevation: 2,
      margin: const EdgeInsets.symmetric(vertical: 8.0),
      child: ListTile(
        leading: Icon(icon, size: 40, color: Theme.of(context).primaryColor),
        title: Text(title, style: const TextStyle(fontWeight: FontWeight.bold)),
        subtitle: Text(subtitle),
        trailing: const Icon(Icons.arrow_forward_ios),
        onTap: onTap,
      ),
    );
  }
}