12 lines
566 B
C#
12 lines
566 B
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace NexusReader.Application.Queries.Reader;
|
|
|
|
[JsonDerivedType(typeof(TextSegmentBlock), "text")]
|
|
[JsonDerivedType(typeof(AiActionTriggerBlock), "trigger")]
|
|
public abstract record ContentBlock(string Id);
|
|
public record TextSegmentBlock(string Id, string Content) : ContentBlock(Id);
|
|
public record AiActionTriggerBlock(string Id, string Dialogue, List<string> ActionOptions) : ContentBlock(Id);
|
|
|
|
public record ReaderPageViewModel(List<ContentBlock> Blocks, int CurrentChapterIndex, int TotalChapters, string ChapterTitle);
|