import 'package:equatable/equatable.dart';

import '../../domain/model/available_io_model.dart';
import '../../domain/model/closed_io_model.dart';

class TabState extends Equatable {
  final AvailableIOModel availableItems;
  final ClosedIOModel closedItems;
  final bool loading;
  final String errorMessage;

  const TabState(
    this.availableItems,
    this.closedItems,
    this.loading,
    this.errorMessage,
  );

  TabState copyWith({
    AvailableIOModel? availableItems,
    ClosedIOModel? closedItems,
    bool? loading,
    String? errorMessage,
  }) {
    return TabState(
      availableItems ?? this.availableItems,
      closedItems ?? this.closedItems,
      loading ?? this.loading,
      errorMessage ?? this.errorMessage,
    );
  }

  @override
  List<Object> get props =>
      [availableItems, closedItems, loading, errorMessage];
}
