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

class CustomSelector extends StatelessWidget {
  final bool isTablet;
  final String title;
  final EdgeInsetsGeometry? padding;
  final double? fontSize;
  final VoidCallback onTap;
  const CustomSelector({
    super.key,
    required this.isTablet,
    required this.title,
    this.padding,
    this.fontSize,
    required this.onTap,
  });

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
        onTap: onTap,
        child: Container(
          width: double.infinity,
          padding: padding ?? EdgeInsets.all(4.w),
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.circular(3.w),
            border: Border.all(color: Colors.grey.shade300),
          ),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Text(
                title,
                style: TextStyle(
                  fontWeight: FontWeight.bold,
                  fontSize:
                      fontSize ??
                      (isTablet
                          ? (AppFontSize.medium - 1.25).sp
                          : (AppFontSize.small - 1.25).sp),
                  color: Colors.grey.shade700,
                ),
              ),
              Icon(
                Icons.arrow_forward_ios,
                size: 3.5.w,
                color: Colors.grey.shade700,
              ),
            ],
          ),
        ),
      )
    ;
  }
}
