import 'package:flutter/widgets.dart';
import 'package:pshared/generated/i18n/ps_localizations.dart';

enum OperationStatus {
  processing,
  success,
  error,
}


extension OperationStatusX on OperationStatus {
  /// Returns the localized string for this status,
  /// e.g. “Processing”, “Success”, “Error”.
  String localized(BuildContext context) {
    final loc = PSLocalizations.of(context)!;
    switch (this) {
      case OperationStatus.processing:
        return loc.operationStatusProcessing;
      case OperationStatus.success:
        return loc.operationStatusSuccess;
      case OperationStatus.error:
        return loc.operationStatusError;
    }
  }
}
