import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import 'package:pweb/controllers/settings/profile_actions.dart';
import 'package:pweb/models/settings/profile_action_section.dart';
import 'package:pweb/pages/settings/profile/actions/button.dart';


class ProfilePasswordActionButton extends StatelessWidget {
  const ProfilePasswordActionButton({super.key, required this.label});

  final String label;

  @override
  Widget build(BuildContext context) {
    final controller = context.watch<ProfileActionsController>();

    return ProfileActionButton(
      icon: Icons.lock_outline,
      label: label,
      isSelected: controller.isExpanded(ProfileActionSection.password),
      onPressed: () => controller.toggle(ProfileActionSection.password),
    );
  }
}
