import 'package:equatable/equatable.dart';

enum FileType { folder, file }

class FileItem extends Equatable {
  final String name;
  final String path;
  final FileType type;
  final int size; // in bytes, 0 for folders
  final DateTime lastModified;

  const FileItem({
    required this.name,
    required this.path,
    required this.type,
    this.size = 0,
    required this.lastModified,
  });

  @override
  List<Object?> get props => [name, path, type, size, lastModified];

  FileItem copyWith({
    String? name,
    String? path,
    FileType? type,
    int? size,
    DateTime? lastModified,
  }) {
    return FileItem(
      name: name ?? this.name,
      path: path ?? this.path,
      type: type ?? this.type,
      size: size ?? this.size,
      lastModified: lastModified ?? this.lastModified,
    );
  }
}
