import { useState, useEffect, useCallback } from "react";
import { TIERS } from "../lib/tradeGate.js";
import { getTierRank, isTierClickable } from "../lib/tierNavigation.js";
import AutomatedSetupModal from "./AutomatedSetupModal.jsx";
/**
* Dashboard.jsx
*
* Design intent: this is a trading terminal, not a marketing page --
* dense, precise, calm. The tier ladder (dashboard -> manual ->
* automated) is rendered as a real structural element because it IS
* the real security model (see tradeGate.js), not decoration. Numbers
* that came from the walk-forward-validated baseline are visually
* distinguished from numbers the live adaptive layer just computed --
* conflating "this was proven out-of-sample" with "this is a live
* guess" in the UI would be the same category of silent-failure this
* whole project has consistently flagged as the dangerous thing to do.
*/
const TIER_INFO = [
{ key: TIERS.DASHBOARD, label: "Dashboard", desc: "Read-only. Balances and strategy status." },
{ key: TIERS.MANUAL, label: "Manual approval", desc: "See signals, tap to confirm, sign on Ledger." },
{ key: TIERS.AUTOMATED, label: "Automated", desc: "Runs within limits you set. Ledger confirmation still required per trade." },
];
function TierLadder({ currentTier, onRequestTierChange }) {
const currentRank = getTierRank(currentTier);
return (