import 'package:equatable/equatable.dart';
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/community_model.dart';
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/product_model.dart';
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/space_model.dart';
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/tag.dart';
import 'package:syncrow_web/pages/spaces_management/space_model/models/space_template_model.dart';

abstract class SpaceManagementState extends Equatable {
  const SpaceManagementState();

  @override
  List<Object> get props => [];
}

class SpaceManagementInitial extends SpaceManagementState {}

class SpaceManagementLoading extends SpaceManagementState {}

class SpaceManagementLoaded extends SpaceManagementState {
  final List<CommunityModel> communities;
  final List<ProductModel> products;
  CommunityModel? selectedCommunity;
  SpaceModel? selectedSpace;
  List<SpaceTemplateModel>? spaceModels;
  List<Tag> allTags;

  SpaceManagementLoaded(
      {required this.communities,
      required this.products,
      this.selectedCommunity,
      this.selectedSpace,
      this.spaceModels,
      required this.allTags});
}

class BlankState extends SpaceManagementState {
  final List<CommunityModel> communities;
  final List<ProductModel> products;
  List<SpaceTemplateModel>? spaceModels;
  final List<Tag> allTags;

  BlankState(
      {required this.communities, required this.products, this.spaceModels, required this.allTags});
}

class SpaceCreationSuccess extends SpaceManagementState {
  final List<SpaceModel> spaces;

  const SpaceCreationSuccess({required this.spaces});

  @override
  List<Object> get props => [spaces];
}

class SpaceManagementError extends SpaceManagementState {
  final String errorMessage;

  const SpaceManagementError(this.errorMessage);

  @override
  List<Object> get props => [errorMessage];
}

class SpaceModelLoaded extends SpaceManagementState {
  List<SpaceTemplateModel> spaceModels;
  final List<ProductModel> products;
  final List<CommunityModel> communities;
  final List<Tag> allTags;

  SpaceModelLoaded(
      {required this.communities,
      required this.products,
      required this.spaceModels,
      required this.allTags});

  @override
  List<Object> get props => [communities, products, spaceModels, allTags];
}
