import 'package:flutter/material.dart';

import 'package:pweb/pages/status/page.dart';
import 'package:pweb/services/verification.dart';

import 'package:pweb/generated/i18n/app_localizations.dart';


class AccountVerificationPage extends StatelessWidget {
  final String token;

  const AccountVerificationPage({super.key, required this.token});

  @override
  Widget build(BuildContext context) => StatusPage<bool>(
    operation: () async => VerificationService.verify(token), 
    errorMessage: AppLocalizations.of(context)!.accountVerificationFailed,
    successMessage: AppLocalizations.of(context)!.accountVerified, 
    successDescription: AppLocalizations.of(context)!.accountVerifiedDescription,
  );
}
