import 'package:flutter/material.dart';

import '../../../../../core/styles/my_colors.dart';
import '../../../../../core/styles/my_dimensions.dart';
import '../../../../../core/styles/my_font.dart';

class ProductListFilterChip extends StatelessWidget {
  final int id;
  final String text;
  final bool initialValue;
  final Function(int) onSelect;

  ProductListFilterChip({
    Key? key,
    required this.initialValue,
    required this.onSelect,
    required this.id,
    required this.text,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        onSelect(id);
      },
      child: Chip(
        padding: EdgeInsets.symmetric(
          vertical: MyDimens.dimen4,
          horizontal: MyDimens.dimen8,
        ),
        side: initialValue
            ? BorderSide(
                color: MyColor.orange,
              )
            : null,
        backgroundColor: (initialValue ? MyColor.orange : Color(0xFF252B42))
            .withOpacity(0.1),
        label: Text(
          text,
          style: MyFont.medium12.copyWith(
            color: initialValue ? MyColor.orange : Color(0xFF121212),
          ),
        ),
      ),
    );
  }
}
