import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:gap/gap.dart';
import 'package:pharmacy_mobile/widgets/text_widget.dart';

class SettingWidget extends StatelessWidget {
  final String title;
  final String value;
  final IconData icon;
  final VoidCallback? onPressed;
  const SettingWidget({super.key, required this.title, required this.value, required this.icon, this.onPressed});

  @override
  Widget build(BuildContext context) {
    return Container(
        padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
        decoration: BoxDecoration(
            color: const Color.fromRGBO(28, 17, 32, 0.678),
            border: Border.all(color: const Color.fromRGBO(74, 74, 74, 0.127)),
            borderRadius: BorderRadius.circular(8.0)),
        child: SizedBox(
          width: MediaQuery.of(context).size.width,
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Row(
                children: [
                  FaIcon(icon, color: const Color.fromRGBO(255, 255, 255, 1), size: 20),
                  const Gap(16),
                  TextWidget(text: title, size: 12, color: const Color.fromRGBO(255, 255, 255, 1)),
                ],
              ),
              GestureDetector(
                onTap: onPressed,
                child: Row(
                  children: [
                    TextWidget(text: value, size: 12, color: const Color.fromRGBO(255, 255, 255, 1)),
                    const Gap(16),
                    FaIcon(Icons.arrow_forward_ios, color: const Color.fromRGBO(255, 255, 255, 1), size: 12),
                  ],
                ),
              )
            ],
          ),
        ));
  }
}
