import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

/// Widget untuk menampilkan informasi transaksi Firefly
/// Menampilkan sumber (kiri), panah (tengah), dan destinasi (kanan)
class FireflyTransactionInfo extends StatelessWidget {
  final String sourceAccount;
  final String destinationAccount;

  const FireflyTransactionInfo({
    super.key,
    required this.sourceAccount,
    required this.destinationAccount,
  });

  @override
  Widget build(BuildContext context) {
    final courierPrime = GoogleFonts.courierPrime(
      textStyle: const TextStyle(
        fontSize: 14,
        height: 1.2,
      ),
    );

    return Container(
      width: double.infinity,
      padding: const EdgeInsets.all(8.0),
      color: Colors.white,
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          // Sumber akun
          Expanded(
            flex: 3,
            child: Text(
              sourceAccount,
              style: courierPrime,
              textAlign: TextAlign.left,
              overflow: TextOverflow.ellipsis,
            ),
          ),
          // Panah kanan
          const Expanded(
            flex: 1,
            child: Icon(
              Icons.arrow_forward,
              size: 16,
            ),
          ),
          // Destinasi akun
          Expanded(
            flex: 3,
            child: Text(
              destinationAccount,
              style: courierPrime,
              textAlign: TextAlign.right,
              overflow: TextOverflow.ellipsis,
            ),
          ),
        ],
      ),
    );
  }
}