import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/constants/assets.dart';
import 'package:syncrow_web/web_layout/default_container.dart';

class PrefReversCardWidget extends StatelessWidget {
  final void Function() onTap;
  final String title;
  final String body;
  const PrefReversCardWidget({
    super.key,
    required this.title,
    required this.body,
    required this.onTap,
  });

  @override
  Widget build(BuildContext context) {
    return DefaultContainer(
      padding: const EdgeInsets.all(18),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.start,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              Expanded(
                flex: 8,
                child: Text(
                  title,
                  style: const TextStyle(
                    color: ColorsManager.grayBorder,
                    fontSize: 15,
                  ),
                ),
              ),
              const SizedBox(
                width: 20,
              ),
              Expanded(
                flex: 2,
                child: InkWell(
                  onTap: onTap,
                  child: Container(
                    padding: const EdgeInsets.all(3),
                    decoration: BoxDecoration(
                        color: ColorsManager.whiteColors,
                        borderRadius: const BorderRadius.horizontal(
                            left: Radius.circular(10),
                            right: Radius.circular(10)),
                        border: Border.all(color: ColorsManager.grayBorder)),
                    child: SvgPicture.asset(
                      Assets.reverseArrows,
                      height: 15,
                    ),
                  ),
                ),
              )
            ],
          ),
          SizedBox(
            width: 100,
            child: Text(
              body,
              style: const TextStyle(
                color: ColorsManager.blackColor,
                fontWeight: FontWeight.w500,
                fontSize: 18,
              ),
            ),
          ),
        ],
      ),
    );
  }
}
