using PlotLine.Models; namespace PlotLine.ViewModels; public sealed class NamesLibraryViewModel { public Project Project { get; init; } = new(); public NameSearchFilter Filter { get; init; } = new(); public IReadOnlyList Locales { get; init; } = []; public IReadOnlyList Books { get; init; } = []; public IReadOnlyList Results { get; init; } = []; public int TotalRows => Results.FirstOrDefault()?.TotalRows ?? 0; public int TotalPages => Filter.PageSize <= 0 ? 1 : Math.Max(1, (int)Math.Ceiling(TotalRows / (double)Filter.PageSize)); }