import { useSessionContext } from '@blocklet/payment-react-headless';
import { detectScenario } from '../../utils/scenario-detector';
import CompositePanel from './composite-panel';
import CreditTopupPanel from './credit-topup-panel';

// Phase 2 stubs — fallback to Composite for now
const SubscriptionPanel = CompositePanel;

export default function ScenarioRouter() {
  const { session, items } = useSessionContext();
  const scenario = detectScenario(session, items);

  switch (scenario) {
    case 'subscription':
      return <SubscriptionPanel />;
    case 'credit-topup':
      return <CreditTopupPanel />;
    case 'composite':
    default:
      return <CompositePanel />;
  }
}
