import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart';
// ignore: depend_on_referenced_packages
import 'package:core_localization/core_localization.dart';

/// A card displaying the overall verification progress of documents.
class DocumentsProgressCard extends StatelessWidget {
  /// The number of verified documents.
  final int completedCount;

  /// The total number of required documents.
  final int totalCount;

  /// The progress ratio (0.0 to 1.0).
  final double progress;

  const DocumentsProgressCard({
    super.key,
    required this.completedCount,
    required this.totalCount,
    required this.progress,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.all(UiConstants.space4),
      decoration: BoxDecoration(
        color: UiColors.bgPopup,
        borderRadius: UiConstants.radiusLg,
        border: Border.all(color: UiColors.border),
      ),
      child: Column(
        children: <Widget>[
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: <Widget>[
              Text(
                t.staff_documents.verification_card.title,
                style: UiTypography.body1m.textPrimary,
              ),
              Text(
                t.staff_documents.verification_card.progress(
                  completed: completedCount,
                  total: totalCount,
                ),
                style: UiTypography.body2r.primary,
              ),
            ],
          ),
          const SizedBox(height: UiConstants.space2),
          ClipRRect(
            borderRadius: UiConstants.radiusSm,
            child: LinearProgressIndicator(
              value: progress,
              minHeight: UiConstants.space2,
              backgroundColor: UiColors.border,
              valueColor: const AlwaysStoppedAnimation<Color>(
                UiColors.primary,
              ),
            ),
          ),
        ],
      ),
    );
  }
}
