import 'package:flutter/material.dart';
import 'package:satu/shared/app_colors.dart';
import 'package:satu/shared/shared_styles.dart';


class OptionPill extends StatelessWidget {

  const OptionPill({required this.text, required this.selected, this.onTap});

  final String text;
  final bool selected;
  final Function()? onTap;

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: const BoxDecoration(
        borderRadius: BorderRadius.all(
          Radius.circular(5),
        ),
      ),
      child: Material(
        color: Colors.transparent,
        child: InkWell(
          onTap: onTap,
          child: Container(
            constraints: const BoxConstraints(
              minWidth: 100.0
            ),
            padding: const EdgeInsets.symmetric(vertical: 7, horizontal: 16),
            decoration: BoxDecoration(
              gradient: !selected ? null : primaryGradient,
              borderRadius: const BorderRadius.all(
                Radius.circular(5),
              ),
              color: selected ? Colors.black : Colors.transparent,
            ),
            child: Text(
              text,
              textAlign: TextAlign.center,
              style: TextStyle(
                color: selected ? blackColor : placeholderColor,
                fontWeight: FontWeight.w500,
                fontSize: 14,
              ),
            ),
          ),
        ),
      ),
    );
  }
}