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

class FilteredDateRange extends StatelessWidget {
  final String value;
  final VoidCallback onTap;
  const FilteredDateRange({super.key, required this.value, required this.onTap});

  @override
  Widget build(BuildContext context) {
    final bool isTablet = 100.w >= 600;
    return InkWell(
      onTap: onTap,
      child: Container(
        height: 5.5.h,
        width: double.infinity,
        constraints: BoxConstraints(maxWidth: double.infinity),
        padding: EdgeInsets.symmetric(horizontal: 3.w),
        decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.circular(2.5.w),
          border: Border.all(color: Colors.grey.shade300),
        ),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.start,
          children: [
            Icon(
              Icons.calendar_month_outlined,
              size: 4.5.w,
              color: Colors.grey[600],
            ),
            SizedBox(width: 2.w),
            Expanded(
              child: Text(
                value,
                textAlign: TextAlign.start,
                overflow: TextOverflow.ellipsis,
                style: TextStyle(
                  fontSize: isTablet
                      ? AppFontSize.medium.sp
                      : AppFontSize.small.sp,
                  color: Colors.grey[700],
                  fontWeight: FontWeight.w600,
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
