@model SceneEditViewModel
@{
    var status = Model.RevisionStatuses.FirstOrDefault(x => x.Value == Model.RevisionStatusID.ToString())?.Text ?? "Not set";
    var pov = Model.CharacterOptions.FirstOrDefault(x => x.Value == Model.POVCharacterID?.ToString())?.Text
        ?? Model.SceneCharacters.FirstOrDefault(x => x.RoleInSceneTypeName?.Contains("POV", StringComparison.OrdinalIgnoreCase) == true)?.CharacterName
        ?? "No POV";
    var wordCount = Model.Workflow.ActualWordCount ?? Model.Workflow.EstimatedWordCount ?? 0;
    var locationCount = new[] { Model.PrimaryLocationID }.Where(x => x.HasValue).Select(x => x!.Value)
        .Concat(Model.SceneCharacters.Where(x => x.LocationID.HasValue).Select(x => x.LocationID!.Value))
        .Concat(Model.SceneAssetLocations.Select(x => x.LocationID))
        .Distinct()
        .Count();
    var warningCount = Model.Warnings.Count + Model.AgeContinuityWarnings.Count;
}

<section class="scene-inspector-v2-health" aria-label="Scene health" data-scene-summary-part="health">
    <div>
        <span>Status</span>
        <strong>@status</strong>
    </div>
    <div>
        <span>POV</span>
        <strong>@pov</strong>
    </div>
    <div>
        <span>Words</span>
        <strong>@wordCount.ToString("N0")</strong>
    </div>
    <div>
        <span>Characters</span>
        <strong>@Model.SceneCharacters.Count</strong>
    </div>
    <div>
        <span>Assets</span>
        <strong>@Model.AssetEvents.Select(x => x.StoryAssetID).Distinct().Count()</strong>
    </div>
    <div>
        <span>Locations</span>
        <strong>@locationCount</strong>
    </div>
    <div class="@(warningCount > 0 ? "attention" : "")">
        <span>Warnings</span>
        <strong>@warningCount</strong>
    </div>
</section>
