import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';

class MenuItem {
  final IconData icon;
  final String title;
  final VoidCallback? onTap;

  const MenuItem({
    required this.icon,
    required this.title,
    this.onTap,
  });
}

class ProfileState extends Equatable {
  final String username;
  final String welcomeText;
  final List<MenuItem> menuList;
  final bool isLoggingOut;
  final String? logoutError;
  final bool logoutSuccess;

  const ProfileState({
    this.username = '',
    this.welcomeText = '',
    this.menuList = const [],
    this.isLoggingOut = false,
    this.logoutError,
    this.logoutSuccess = false,
  });

  ProfileState copyWith({
    String? username,
    String? welcomeText,
    List<MenuItem>? menuList,
    bool? isLoggingOut,
    String? logoutError,
    bool? logoutSuccess,
  }) {
    return ProfileState(
      username: username ?? this.username,
      welcomeText: welcomeText ?? this.welcomeText,
      menuList: menuList ?? this.menuList,
      isLoggingOut: isLoggingOut ?? this.isLoggingOut,
      logoutError: logoutError ?? this.logoutError,
      logoutSuccess: logoutSuccess ?? this.logoutSuccess,
    );
  }

  @override
  List<Object?> get props => [
        username,
        welcomeText,
        menuList,
        isLoggingOut,
        logoutError,
        logoutSuccess,
      ];
}