import 'package:flutter/material.dart';
import 'package:kmobile/features/enquiry/screens/enquiry_screen.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart';
import '../../../l10n/app_localizations.dart';

class ChequeManagementScreen extends StatefulWidget {
  const ChequeManagementScreen({super.key});

  @override
  State<ChequeManagementScreen> createState() => _ChequeManagementScreen();
}

class _ChequeManagementScreen extends State<ChequeManagementScreen> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(
          AppLocalizations.of(context).chequeManagement,
          style:
              const TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
        ),
        centerTitle: false,
      ),
      body: ListView(
        children: [
          const SizedBox(height: 15),
          ChequeManagementTile(
            icon: Symbols.add,
            label: AppLocalizations.of(context).requestChequeBook,
            onTap: () {},
          ),
          const Divider(height: 1),
          ChequeManagementTile(
            icon: Symbols.data_alert,
            label: AppLocalizations.of(context).enquiry,
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => const EnquiryScreen()),
              );
            },
          ),
          const Divider(height: 1),
          ChequeManagementTile(
            icon: Symbols.approval_delegation,
            label: AppLocalizations.of(context).chequeDeposit,
            onTap: () {},
          ),
          const Divider(height: 1),
          ChequeManagementTile(
            icon: Symbols.front_hand,
            label: AppLocalizations.of(context).stopCheque,
            onTap: () {},
          ),
          const Divider(height: 1),
          ChequeManagementTile(
            icon: Symbols.cancel_presentation,
            label: AppLocalizations.of(context).revokeStop,
            onTap: () {},
          ),
          const Divider(height: 1),
          ChequeManagementTile(
            icon: Symbols.payments,
            label: AppLocalizations.of(context).positivePay,
            onTap: () {},
          ),
          const Divider(height: 1),
        ],
      ),
    );
  }
}

class ChequeManagementTile extends StatelessWidget {
  final IconData icon;
  final String label;
  final VoidCallback onTap;

  const ChequeManagementTile({
    super.key,
    required this.icon,
    required this.label,
    required this.onTap,
  });

  @override
  Widget build(BuildContext context) {
    return ListTile(
      leading: Icon(icon),
      title: Text(label),
      trailing: const Icon(Symbols.arrow_right, size: 20),
      onTap: onTap,
    );
  }
}
