import 'package:flutter/material.dart';
import 'package:niogu_app/core/constants/app_color.dart';
import 'package:niogu_app/core/constants/app_font_size.dart';
import 'package:sizer/sizer.dart';

class QuotaIndicator extends StatelessWidget {
  final int current;
  final int max;
  const QuotaIndicator({super.key, required this.current, required this.max});

  @override
  Widget build(BuildContext context) {
    final bool isTablet = 100.w >= 600;
    return Padding(
      padding: EdgeInsets.fromLTRB(5.w, 1.h, 5.w, 2.h),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Text(
                "Kuota",
                style: TextStyle(
                  fontSize: isTablet
                      ? (AppFontSize.medium - 1.25).sp
                      : (AppFontSize.small - 1.25).sp,
                  fontWeight: FontWeight.bold,
                  color: Colors.grey[800],
                ),
              ),
              Text(
                "$current / $max Outlet",
                style: TextStyle(
                  fontSize: isTablet
                      ? (AppFontSize.medium - 1.25).sp
                      : (AppFontSize.small - 1.25).sp,
                  fontWeight: FontWeight.bold,
                  color: AppColor.primaryColor,
                ),
              ),
            ],
          ),
          SizedBox(height: 1.h),
          ClipRRect(
            borderRadius: BorderRadius.circular(1.w),
            child: LinearProgressIndicator(
              value: current / max,
              minHeight: 1.h,
              backgroundColor: Colors.grey[200],
              valueColor: AlwaysStoppedAnimation<Color>(AppColor.primaryColor),
            ),
          ),
        ],
      ),
    );
  }
}
