import 'package:flutter/material.dart';
import 'package:aves/model/entry/entry.dart';
import 'package:aves/widgets/dialogs/aves_confirmation_dialog.dart';
import 'package:aves/widgets/dialogs/convert_entry_dialog.dart';

/// Questo file contiene SOLO i dialog.
/// Nessuna logica, nessuna azione, nessuna dipendenza pesante.
/// Versione ultra‑ottimizzata.

class EntryActionDialogs {
  static Future<bool?> confirmDelete(
    BuildContext context,
    List<AvesEntry> entries,
  ) {
    return showDialog<bool>(
      context: context,
      builder: (_) => AvesConfirmationDialog(
        title: 'Elimina',
        message: 'Vuoi eliminare ${entries.length} elementi?',
      ),
    );
  }

  static Future<void> showConvertDialog(
    BuildContext context,
    AvesEntry entry,
  ) {
    return showDialog(
      context: context,
      builder: (_) => ConvertEntryDialog(entry: entry),
    );
  }

  static Future<void> showEditDateDialog(
    BuildContext context,
    List<AvesEntry> entries,
  ) {
    return showDialog(
      context: context,
      builder: (_) => EditDateDialog(entries: entries),
    );
  }

  static Future<void> showEditLocationDialog(
    BuildContext context,
    List<AvesEntry> entries,
  ) {
    return showDialog(
      context: context,
      builder: (_) => EditLocationDialog(entries: entries),
    );
  }

  static Future<void> showEditTitleDescriptionDialog(
    BuildContext context,
    List<AvesEntry> entries,
  ) {
    return showDialog(
      context: context,
      builder: (_) => EditTitleDescriptionDialog(entries: entries),
    );
  }

  static Future<void> showEditRatingDialog(
    BuildContext context,
    List<AvesEntry> entries,
  ) {
    return showDialog(
      context: context,
      builder: (_) => EditRatingDialog(entries: entries),
    );
  }

  static Future<void> showEditTagsDialog(
    BuildContext context,
    List<AvesEntry> entries,
  ) {
    return showDialog(
      context: context,
      builder: (_) => EditTagsDialog(entries: entries),
    );
  }

  static Future<void> showRemoveMetadataDialog(
    BuildContext context,
    List<AvesEntry> entries,
  ) {
    return showDialog(
      context: context,
      builder: (_) => RemoveMetadataDialog(entries: entries),
    );
  }

  static Future<void> showSlideshowDialog(
    BuildContext context,
    List<AvesEntry> entries,
  ) {
    return showDialog(
      context: context,
      builder: (_) => SlideshowDialog(entries: entries),
    );
  }

  static Future<void> showStatsDialog(
    BuildContext context,
    List<AvesEntry> entries,
  ) {
    return showDialog(
      context: context,
      builder: (_) => StatsDialog(entries: entries),
    );
  }
}
