using CommunityToolkit.Mvvm.ComponentModel; using FrameLedger.App.Services; using FrameLedger.Application.Import; namespace FrameLedger.App.ViewModels; /// One row of FR-1.2's review checklist: ticked by default when it can be imported, with the store, the name, the executable the import would add, and why it cannot when it cannot. public sealed partial class ImportCandidateViewModel : ObservableObject { [ObservableProperty] private bool _isSelected; public ImportCandidateViewModel(ImportCandidate candidate) { Candidate = candidate ?? throw new ArgumentNullException(nameof(candidate)); _isSelected = candidate.CanImport; Note = candidate.AlreadyInLibrary ? Strings.Import_Note_Already : candidate.MovedFrom is not null ? Strings.Import_Note_Moved : candidate.ExePath is null || candidate.ExecutableMissing ? Strings.Import_Note_NoExe : candidate.ExecutableGuessed ? Strings.Import_Note_Guessed : string.Empty; } public ImportCandidate Candidate { get; } public bool CanImport => Candidate.CanImport; public string PlatformText => Formats.Platform(Candidate.Game.Platform); public string Name => Candidate.Game.Name; public string ExeText => Candidate.ExePath ?? Strings.Common_Dash; /// Already in the library (under this drive letter or, since 2026-09-23, another), no executable found, or a guessed executable the user should check. public string Note { get; } }