import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import '../../utils/translations_delegate_base_utils.dart';

class ConfirmationDialog extends StatefulWidget {
  final String? title;
  final Function? onTapGrant;

  ConfirmationDialog({this.title, this.onTapGrant});

  @override
  _ConfirmationDialogState createState() => _ConfirmationDialogState();
}

class _ConfirmationDialogState extends State<ConfirmationDialog> {
  @override
  Widget build(BuildContext context) {
    return AlertDialog(
      title: Text("Alert"),
      content: Text(widget.title!),
      actions: [
        TextButton(
          child: Text(TranslationBase.of(context).cancel),
          onPressed: () {
            Navigator.pop(context);
          },
        ),
        TextButton(
          child: Text(TranslationBase.of(context).ok),
          onPressed: () {
            Navigator.pop(context);
            widget.onTapGrant!();
          },
        )
      ],
    );
  }
}
