import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core'; import type { Tone } from '../list/list.types'; import { Badge } from './badge'; export type StatusKind = 'info' | 'ok' | 'warn' | 'err'; export interface StatusMessage { kind: StatusKind; text: string; } export interface WindowBadge { label: string; tone: Tone; } const GLYPH: Record = { info: 'ℹ', ok: '✓', warn: '!', err: '✕' }; /** * Ventana de formulario SBO: título con insignia de estado, cuerpo, zona de acciones y barra de estado. * * Contenido: el cuerpo va como contenido normal; las acciones con `sboActions` (izquierda) y * `sboActionsEnd` (derecha, ej. "Copiar de/a"). */ @Component({ selector: 'sbo-window', changeDetection: ChangeDetectionStrategy.OnPush, imports: [Badge], templateUrl: './window.html', styleUrl: './window.css', }) export class SboWindow { readonly title = input.required(); readonly badge = input(); readonly status = input({ kind: 'info', text: '' }); protected readonly glyph = computed(() => GLYPH[this.status().kind]); }