import 'package:flutter/material.dart';
import '../../core/theme/app_colors.dart';

/// Pencil Component/ListCard — 列表卡片（报销申请列表等）
class ListCard extends StatelessWidget {
  final String cardNo;
  final String description;
  final String amount;
  final String date;
  final Widget? statusTag;
  final VoidCallback? onTap;

  const ListCard({
    super.key,
    required this.cardNo,
    required this.description,
    required this.amount,
    required this.date,
    this.statusTag,
    this.onTap,
  });

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: Container(
        padding: const EdgeInsets.all(12),
        decoration: BoxDecoration(
          color: AppColors.bgCard,
          borderRadius: BorderRadius.circular(8),
        ),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Text(
                  cardNo,
                  style: const TextStyle(
                    fontSize: 14,
                    fontWeight: FontWeight.w600,
                    color: AppColors.textPrimary,
                  ),
                ),
                Text(
                  amount,
                  style: const TextStyle(
                    fontSize: 16,
                    fontWeight: FontWeight.w700,
                    color: AppColors.amountPrimary,
                  ),
                ),
              ],
            ),
            const SizedBox(height: 8),
            Text(
              description,
              style: const TextStyle(
                fontSize: 14,
                color: AppColors.textSecondary,
              ),
            ),
            const SizedBox(height: 8),
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Text(
                  date,
                  style: const TextStyle(
                    fontSize: 12,
                    color: AppColors.textPlaceholder,
                  ),
                ),
                if (statusTag != null) statusTag!,
              ],
            ),
          ],
        ),
      ),
    );
  }
}
