import { Component, input } from '@angular/core'; import { MatCardModule } from '@angular/material/card'; import { Plot } from '../plot'; import { Section } from './tea-sections'; @Component({ selector: 'app-tea-section', imports: [MatCardModule, Plot], template: ` {{ section().title }} @for (block of section().blocks; track $index) { @if (block.title) {

{{ block.title }}

} @if (block.text) {

{{ block.text }}

} @if (block.fields; as fields) {
@for (field of fields; track $index) {
{{ field[0] }}
{{ field[1] }}
}
} @if (block.table; as table) { @if (table.rows.length) { @for (header of table.headers; track $index) { } @for (row of table.rows; track $index) { @for (cell of row; track $index) { } }
{{ header }}
{{ cell }}
} @else {

—

} } @if (block.chart; as chart) {

{{ chart.title }}

} } @empty {

—

}
`, styles: ` :host { display: block; } mat-card-content { overflow-x: auto; } dl { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-block: var(--space-3); } dt { color: var(--color-text-secondary); font-size: 12px; } dd { margin: 0; font-weight: 500; } `, }) export class TeaSection { readonly section = input.required
(); }