# neurotron/dashboard/panes/status.py

import sys

class StatusPane:
    def render(self, ctx, x, y, w, h):
        snap = ctx.cognitive_snapshot()

        line1 = f"MODE: {snap['system_mode'].upper()}  TRM: {snap['trm_mode'].upper()}"
        line2 = (
            f"CogState: {snap['cog_state'].upper()}  "
            f"Depth: {snap['depth']}  "
            f"Valence: {snap['valence']:+.2f}  "
            f"Energy: {snap['energy']:.1f}"
        )

        sys.stdout.write(f"\033[{y};{x}H{line1[:w]}")
        sys.stdout.write(f"\033[{y+1};{x}H{line2[:w]}")
