import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';

class FlushSensorOption extends StatelessWidget {
  final String icon;
  final String label;
  final VoidCallback onTap;
  final String? sliderValue;
  final bool withArrow;

  const FlushSensorOption({
    super.key,
    required this.icon,
    required this.label,
    required this.onTap,
    required this.withArrow,
    this.sliderValue = '',
  });

  @override
  Widget build(BuildContext context) {
    return DefaultContainer(
      margin: const EdgeInsets.only(bottom: 5),
      padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 20),
      onTap: onTap,
      child: Row(
        children: [
          SvgPicture.asset(icon),
          const SizedBox(width: 25),
          Expanded(
              child:
                  Text(label, style: Theme.of(context).textTheme.bodyMedium)),
          Text(sliderValue!,
              style: Theme.of(context).textTheme.bodyMedium?.copyWith(
                  color: ColorsManager.grayTextColor,
                  fontWeight: FontWeight.bold)),
          withArrow == true
              ? const Icon(Icons.arrow_forward_ios,
                  color: ColorsManager.grayTextColor, size: 15)
              : SizedBox(),
        ],
      ),
    );
  }
}
