import { Component, computed, input } from '@angular/core'; import { Router } from '@angular/router'; import { bodyReadouts } from './body-readouts'; import { BodyDetailViewModel } from './body-detail.model'; /** * Displays the real NASA data for the currently selected body/exoplanet: kind, physical * size/mass, orbital elements, and (for exoplanets) discovery year. Presentational only — * `BodyDetailSceneComponent` supplies the view model and owns navigation state. * * The rows come from `bodyReadouts`, shared with the system view's object card so the same body * cannot read differently in the two places it can be inspected. */ @Component({ selector: 'app-info-panel', template: `

{{ body().name }}

{{ readouts().kindLabel }} · {{ body().hostStarName }}

@if (readouts().measured.length) {

Measured

@for (row of readouts().measured; track row.label) {
{{ row.label }}
{{ row.value }}
}
}

Derived

@for (row of readouts().derived; track row.label) {
{{ row.label }}
{{ row.value }}
}

{{ readouts().provenance }}

` }) export class InfoPanelComponent { readonly body = input.required(); readonly readouts = computed(() => bodyReadouts(this.body())); constructor(private readonly router: Router) {} goBack(): void { void this.router.navigate(['/']); } }