import 'package:flutter/material.dart';
import 'package:syncrow_web/utils/color_manager.dart';

class AccurateDialogWidget extends StatelessWidget {
  final String title;
  final Widget body;
  final void Function() leftOnTap;
  final void Function() rightOnTap;
  const AccurateDialogWidget({
    super.key,
    required this.title,
    required this.body,
    required this.leftOnTap,
    required this.rightOnTap,
  });

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      height: 250,
      width: 500,
      child: Column(
        children: [
          Expanded(
            flex: 3,
            child: Column(
              children: [
                Padding(
                  padding: const EdgeInsets.all(10),
                  child: Text(
                    title,
                    style: TextStyle(
                      fontSize: 24,
                      fontWeight: FontWeight.bold,
                      color: ColorsManager.dialogBlueTitle,
                    ),
                  ),
                ),
                const Divider(
                  indent: 60,
                  endIndent: 60,
                ),
              ],
            ),
          ),
          Expanded(
            flex: 5,
            child: body,
          ),
          Expanded(
            flex: 2,
            child: Column(
              mainAxisAlignment: MainAxisAlignment.end,
              children: [
                const Expanded(child: Divider()),
                Row(
                  children: [
                    Expanded(
                      child: InkWell(
                        borderRadius: const BorderRadius.only(
                          bottomLeft: Radius.circular(26),
                        ),
                        onTap: leftOnTap,
                        child: Container(
                          height: 40,
                          alignment: Alignment.center,
                          decoration: const BoxDecoration(
                            border: Border(
                              right: BorderSide(
                                color: ColorsManager.grayBorder,
                              ),
                            ),
                            borderRadius: BorderRadius.only(
                              bottomLeft: Radius.circular(26),
                            ),
                          ),
                          child: const Text(
                            'Cancel',
                            style: TextStyle(color: ColorsManager.grayBorder),
                          ),
                        ),
                      ),
                    ),
                    Expanded(
                      child: InkWell(
                        borderRadius: const BorderRadius.only(
                          bottomRight: Radius.circular(26),
                        ),
                        onTap: rightOnTap,
                        child: Container(
                          height: 40,
                          alignment: Alignment.center,
                          decoration: const BoxDecoration(
                            border: Border(
                              right: BorderSide(
                                color: ColorsManager.grayBorder,
                              ),
                            ),
                            borderRadius: BorderRadius.only(
                              bottomRight: Radius.circular(26),
                            ),
                          ),
                          child: const Text(
                            'Next',
                            style: TextStyle(
                              color: ColorsManager.blueColor,
                            ),
                          ),
                        ),
                      ),
                    )
                  ],
                )
              ],
            ),
          )
        ],
      ),
    );
  }
}
