import 'package:equatable/equatable.dart';
import '../../models/document_capabilities.dart';

abstract class DocumentViewerState extends Equatable {
  const DocumentViewerState();

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

class DocumentViewerInitial extends DocumentViewerState {}

class DocumentViewerLoading extends DocumentViewerState {}

class DocumentViewerReady extends DocumentViewerState {
  final Uri viewUrl;
  final DocumentCapabilities caps;
  final String token;
  final FileInfo? fileInfo;

  const DocumentViewerReady({
    required this.viewUrl,
    required this.caps,
    required this.token,
    this.fileInfo,
  });

  @override
  List<Object> get props => [
    viewUrl,
    caps,
    token,
    if (fileInfo != null) fileInfo!,
  ];
}

class DocumentViewerError extends DocumentViewerState {
  final String message;

  const DocumentViewerError({required this.message});

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

class DocumentViewerSessionExpired extends DocumentViewerState {}
