@page "/product/{BookId:long}" @inject NavigationManager Navigation
@AuthorName
@for (int i = 1; i <= 5; i++) { } (@CurrentRating.ToString("F1"))

@BookTitle

R @Price.ToString("N2")
@Quantity

Description

@BookDescription

About the Author

@AuthorBio

@code { [Parameter] public long BookId { get; set; } // Mock State - In production, pull these via a Service using BookId inside OnInitialized private string BookTitle { get; set; } = "Letters from M/M (Paris)"; private string AuthorName { get; set; } = "M/M Paris"; private string AuthorBio { get; set; } = "M/M Paris is an art and design partnership consisting of Michaël Amzalag and Mathias Augustyniak, established in 1992. Renowned globally for their influence on fashion, music, and contemporary art layout structures."; private string BookDescription { get; set; } = "An exquisite archive tracking visual graphics, typography, and structural design curation over three decades. Beautifully bound with matte-coated plates and custom layouts."; private decimal Price { get; set; } = 720.00m; // Dynamic Ratings State private double CurrentRating { get; set; } = 4.7; // Formats supported private bool IsPhysicalBook { get; set; } = true; private bool IsEBook { get; set; } = true; private bool CanReadOnline { get; set; } = false; // Image Caching Gallery State private string ActiveImageUrl { get; set; } = "images/book-cover-large.png"; private List Thumbnails { get; set; } = new() { "images/book-cover-large.png", "images/book-inside-1.png", "images/book-inside-2.png" }; private int Quantity { get; set; } = 1; protected override void OnInitialized() { // Default the gallery viewer context logic if (Thumbnails.Any()) { ActiveImageUrl = Thumbnails.First(); } } private void IncreaseQty() => Quantity++; private void DecreaseQty() { if (Quantity > 1) Quantity--; } private void HandleAddToCart() { // Event logic hooked into your structural state layout } private void ViewAllAuthorBooks() { Navigation.NavigateTo($"/catalog?author={Uri.EscapeDataString(AuthorName)}"); } }