import { ChangeDetectionStrategy, Component, computed, inject, input, output } from '@angular/core'; import { BodyDetailViewModel } from '../body-detail/body-detail.model'; import { bodyReadouts } from '../body-detail/body-readouts'; import { BookmarksStore } from '../../shared/state/bookmarks.store'; import { BookmarkIconComponent } from '../../shared/ui/bookmark-icon.component'; import { ReadoutSectionsComponent } from '../body-detail/readout-sections.component'; import { ChevronIconComponent } from '../../shared/ui/chevron-icon.component'; /** * The card shown for a body picked in the system view, without leaving it. * * Selecting a planet used to navigate straight to `/body/:id`, which tore down the system scene * and the camera position with it โ€” so comparing two planets meant flying back in twice. This * shows the same numbers over the live view, and keeps the route as the deliberate step for the * full 3D inspection. * * The rows come from `bodyReadouts` via `ReadoutSectionsComponent`, both shared with the detail * page. Presentational only. */ @Component({ selector: 'app-system-object-card', changeDetection: ChangeDetectionStrategy.OnPush, imports: [BookmarkIconComponent, ChevronIconComponent, ReadoutSectionsComponent], // Positioned and full-bleed like the HUD's own host, so the panel inside it resolves against // the scene rather than against whatever box the inline default would have left it in โ€” which // put the card off the bottom-left corner of the viewport entirely. host: { class: 'pointer-events-none absolute inset-0 block' }, template: `

{{ body().name }}

{{ readouts().kindLabel }} ยท {{ body().hostStarName }}

` }) export class SystemObjectCardComponent { readonly body = input.required(); /** The close control, and anything else that should dismiss the card. */ readonly dismissed = output(); /** Request for the full `/body/:id` route. */ readonly openRequested = output(); readonly bookmarks = inject(BookmarksStore); readonly readouts = computed(() => bodyReadouts(this.body())); }