part of 'category_loader_bloc.dart';

@freezed
class CategoryLoaderState with _$CategoryLoaderState {
  const factory CategoryLoaderState.initial() = _Initial;

  const factory CategoryLoaderState.loading() = _Loading;

  const factory CategoryLoaderState.loaded({
    required List<CategoryModel> categories,
    required bool hasReachedMax,
    required int currentPage,
    required bool isLoadingMore,
    required bool isActive,
    String? searchQuery,
  }) = _Loaded;

  const factory CategoryLoaderState.error(String message) = _Error;

  // Sync-specific states
  const factory CategoryLoaderState.syncing() = _Syncing;

  const factory CategoryLoaderState.syncSuccess(String message) = _SyncSuccess;

  const factory CategoryLoaderState.syncError(String message) = _SyncError;

  // For dropdown/all categories
  const factory CategoryLoaderState.allCategoriesLoaded(
    List<CategoryModel> categories,
  ) = _AllCategoriesLoaded;
}
