import 'package:flutter/foundation.dart';
import 'package:krow/core/data/models/skill.dart';
import 'package:krow/core/data/models/staff_role.dart';

@immutable
class RoleState {
  final bool isLoading;
  final List<StaffRole> staffRoles;
  final List<Skill> skills;
  final StaffRole? editedRole;

  const RoleState(
      {required this.staffRoles,
      this.editedRole,
      this.isLoading = false,
      this.skills = const []});

  copyWith({
    List<StaffRole>? staffRoles,
    StaffRole? editedRole,
    bool? isLoading,
    List<Skill>? skills,
  }) {
    return RoleState(
      staffRoles: staffRoles ?? this.staffRoles,
      editedRole: editedRole ?? this.editedRole,
      isLoading: isLoading ?? this.isLoading,
      skills: skills ?? this.skills,
    );
  }
}
