@namespace MidrandBooks.Components.Pages @using Microsoft.AspNetCore.Components @using MidrandBooks.Models
@if (ActiveTab == "publish") {

Establish Direct SA Distribution

Upload your manuscripts directly. Your files are converted in the background into copy-protected, DRM-sandboxed reflowable epub formats ready for legal distribution.

@if (ShowCustomCategoryInput) {
} else { }
R
@if (!string.IsNullOrEmpty(CoverImagePreview)) { }
@if (!string.IsNullOrEmpty(CoverImagePreview)) {
Cover preview
@CoverImageName Custom image set as primary book artwork
} else {
Simulate Drag/Drop or click to upload Cover Art
}

⚖ Publishing Laws & Moderation Mandates

Midrand Books operates in direct conformity with the **South African National Library Services Act and Copyright protection provisions**. Every submission undergoes rigorous verification:

1
Immediate Background Conversion Files are dispatched to an asynchronous server node to establish reflowable reading templates, embedded copy-protection, and sandboxed audio DRM loops.
2
Editorial Moderation Curation All books must meet formatting criteria and pass legal compliance checks prior to public listing.
3
Real-time Correction Logs If issues are found, the system records moderation logs and returns feedback so authors can easily submit updated artwork or texts.
} else if (ActiveTab == "catalog") {
@if (MyBooks.Any()) { @foreach (var book in MyBooks) {
@if (!string.IsNullOrEmpty(book.CoverUrl)) { @book.Title } else {
@book.Category @book.Title By @book.Author
}

@book.Title

Category: @book.Category • Price: R @book.Price.ToString("F2")

Moderation Status @if (book.Status == "published") { Live & Active } else if (book.Status == "converting") { Converting PDF... } else if (book.Status == "pending_review") { Pending Human Review } else if (book.Status == "rejected") { Rejected / Revision Required } else { Compliance Take Down }

Moderator Feedback: @(book.ModerationFeedback ?? "No feedback provided yet.")

Simulate Curator Actions:
} } else {

No self-published titles registered

Create and publish your very first manuscript on the adjacent tab to load tracking, logs, and moderation tools!

}
}
@code { [Parameter] public List Categories { get; set; } = new(); [Parameter] public EventCallback OnAddCategory { get; set; } [Parameter] public EventCallback OnPublishBook { get; set; } private string ActiveTab { get; set; } = "publish"; private string NewTitle { get; set; } = string.Empty; private string SelectedCategory { get; set; } = "Fiction"; private string CustomCategoryName { get; set; } = string.Empty; private bool ShowCustomCategoryInput { get; set; } = false; private double NewPrice { get; set; } = 120.00; private string NewDescription { get; set; } = string.Empty; // Cover art simulation previews private string CoverImagePreview { get; set; } = string.Empty; private string CoverImageName { get; set; } = string.Empty; private List MyBooks { get; set; } = new(); protected override void OnInitialized() { if (Categories.Any()) { SelectedCategory = Categories.First(); } // Add pre-loaded simulated book for the user on portal initialization MyBooks.Add(new BookModel { Id = "pre-loaded-1", Title = "Highveld Sunset Stories", Author = "Author Khwezi", AuthorId = "khwezi-auth-1", Price = 145.00, Category = "African Literature", CoverColor = "from-rose-950 to-orange-900", Status = "pending_review", ModerationFeedback = "In queue for legal deposit assessment.", ModerationHistory = new List { new ModerationHistoryEntry { Status = "converting", Date = "12/07/2026 10:14", Feedback = "Background compilation complete." } } }); } private void SetActiveTab(string tab) { ActiveTab = tab; } private void ToggleCustomCategory() { ShowCustomCategoryInput = !ShowCustomCategoryInput; } private async Task SaveCustomCategory() { if (!string.IsNullOrWhiteSpace(CustomCategoryName)) { var cat = CustomCategoryName.Trim(); await OnAddCategory.InvokeAsync(cat); SelectedCategory = cat; CustomCategoryName = string.Empty; ShowCustomCategoryInput = false; } } private void TriggerCoverUpload() { // Simulated cover file selection action CoverImagePreview = "https://images.unsplash.com/photo-1543002588-bfa74002ed7e?q=80&w=600&auto=format&fit=crop"; CoverImageName = "sunset-artwork-preview-hires.jpg"; } private void ClearCoverImage() { CoverImagePreview = string.Empty; CoverImageName = string.Empty; } private async Task PublishManuscript() { if (string.IsNullOrWhiteSpace(NewTitle)) return; var book = new BookModel { Id = "self-pub-" + Guid.NewGuid().ToString().Substring(0, 8), Title = NewTitle, Author = "Author Khwezi", Price = NewPrice, Category = SelectedCategory, CoverUrl = CoverImagePreview, CoverColor = "from-indigo-900 to-purple-950", Description = NewDescription, Status = "converting", ModerationFeedback = "Background ingestion process active. Converting raw PDF structure to secure reflowable ePub nodes...", ModerationHistory = new List { new ModerationHistoryEntry { Status = "converting", Date = DateTime.Now.ToString("dd/MM/yyyy HH:mm"), Feedback = "Manuscript uploaded. Worker assigned." } } }; MyBooks.Add(book); await OnPublishBook.InvokeAsync(book); // Reset inputs NewTitle = string.Empty; NewDescription = string.Empty; CoverImagePreview = string.Empty; CoverImageName = string.Empty; ActiveTab = "catalog"; } private void SimulateAction(string bookId, string targetStatus, string feedback) { var book = MyBooks.FirstOrDefault(b => b.Id == bookId); if (book != null) { book.Status = targetStatus; book.ModerationFeedback = feedback; book.ModerationHistory.Insert(0, new ModerationHistoryEntry { Status = targetStatus, Date = DateTime.Now.ToString("dd/MM/yyyy HH:mm"), Feedback = feedback }); } } }