@Table.Label
Key `@Table.Key`
Family @Table.Family
Source @Table.SourceDocument
Columns @Table.Columns.Count
Groups @Table.Groups.Count
Roll Bands @Table.RollBands.Count

@if (!string.IsNullOrWhiteSpace(Table.Notes)) {

@Table.Notes

}

@foreach (var column in Table.Columns) { @column.Label (@column.Key, @column.Role, #@column.SortOrder) }

@if (Table.Groups.Count > 0) {
@foreach (var group in Table.Groups) { @group.Label (@group.Key, #@group.SortOrder) }
}

Roll Bands (@Table.RollBands.Count)
@foreach (var rollBand in Table.RollBands) { @rollBand.Label (@FormatRollRange(rollBand.MinRoll, rollBand.MaxRoll), #@rollBand.SortOrder) }

@code { [Parameter, EditorRequired] public CriticalTableReference Table { get; set; } = null!;

private static string FormatRollRange(int minRoll, int? maxRoll) => maxRoll is null ? $"{minRoll}+" : minRoll == maxRoll ? minRoll.ToString() : $"{minRoll}-{maxRoll}"; }