import 'package:flutter/material.dart';
import 'package:fotodocumentation/l10n/app_localizations.dart';
import 'package:fotodocumentation/pages/ui_utils/general_style.dart';
import 'package:fotodocumentation/utils/di_container.dart';

class PictureDeleteDialog extends StatelessWidget {
  GeneralStyle get _generalStyle => DiContainer.get();

  const PictureDeleteDialog({super.key});

  @override
  Widget build(BuildContext context) {
    return AlertDialog(
      actionsAlignment: MainAxisAlignment.center,
      actionsPadding: EdgeInsets.only(bottom: 50),
      content: Column(
        mainAxisSize: MainAxisSize.min,
        children: [
          Padding(
            padding: const EdgeInsets.only(top: 50.0),
            child: Container(
              padding: const EdgeInsets.all(8),
              decoration: BoxDecoration(
                color: _generalStyle.errorColor,
                shape: BoxShape.circle,
              ),
              child: const Icon(
                Icons.delete_outline,
                size: 32,
                color: Colors.white,
              ),
            ),
          ),
          const SizedBox(height: 16),
          Padding(
            padding: const EdgeInsets.only(left:50, right: 50, bottom: 50),
            child: Text(
              AppLocalizations.of(context)!.deleteDialogText,
              textAlign: TextAlign.center,
              style: TextStyle(
                fontFamily: _generalStyle.fontFamily,
                color: _generalStyle.secondaryTextLabelColor,
                fontSize: 28.71,
                fontWeight: FontWeight.normal,
                
              ),
            ),
          ),
        ],
      ),
      actions: [
        ElevatedButton(
          key: Key("picture_delete_no"),
          onPressed: () => Navigator.of(context).pop(false),
          style: ElevatedButton.styleFrom(
            backgroundColor: _generalStyle.deleteCancelButtonBackgroundColor,
            shape: const StadiumBorder(),
            padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
          ),
          child: Text(
            AppLocalizations.of(context)!.deleteDialogButtonCancel,
            style: TextStyle(
              fontFamily: _generalStyle.fontFamily,
              color: _generalStyle.deleteCancelTextColor,
              fontWeight: FontWeight.bold,
              fontSize: 18.37,
            ),
          ),
        ),
        ElevatedButton(
          key: Key("picture_delete_yes"),
          onPressed: () => Navigator.of(context).pop(true),
          style: ElevatedButton.styleFrom(
            backgroundColor: _generalStyle.primaryButtonBackgroundColor,
            shape: const StadiumBorder(),
            padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
          ),
          child: Text(
            AppLocalizations.of(context)!.deleteDialogButtonApprove,
            style: TextStyle(
              fontFamily: _generalStyle.fontFamily,
              color: Colors.white,
              fontWeight: FontWeight.bold,
              fontSize: 18.37,
            ),
          ),
        ),
      ],
    );
  }
}
