import 'package:flutter/material.dart';

import 'package:pweb/models/settings/profile_action_section.dart';
import 'package:pweb/pages/settings/profile/account/locale.dart';
import 'package:pweb/pages/settings/profile/account/password/password.dart';


class ProfileActionsContent extends StatelessWidget {
  const ProfileActionsContent({
    super.key,
    required this.section,
    required this.passwordSuccessText,
    required this.passwordErrorText,
    required this.oldPasswordLabel,
    required this.newPasswordLabel,
    required this.confirmPasswordLabel,
    required this.savePasswordLabel,
  });

  final ProfileActionSection section;
  final String passwordSuccessText;
  final String passwordErrorText;
  final String oldPasswordLabel;
  final String newPasswordLabel;
  final String confirmPasswordLabel;
  final String savePasswordLabel;

  @override
  Widget build(BuildContext context) {
    switch (section) {
      case ProfileActionSection.language:
        return const LocalePicker();
      case ProfileActionSection.password:
        return AccountPassword(
          successText: passwordSuccessText,
          errorText: passwordErrorText,
          oldPasswordLabel: oldPasswordLabel,
          newPasswordLabel: newPasswordLabel,
          confirmPasswordLabel: confirmPasswordLabel,
          savePassword: savePasswordLabel,
        );
    }
  }
}
