import { useWalletSection } from './useWalletSection';
import { OverviewView } from './OverviewView';
import { ReceiveView } from './ReceiveView';
import { SendView } from './SendView';
import { TransactionsView } from './TransactionsView';
import { CoinsView } from './CoinsView';
import { LightningView } from './LightningView';
import { WalletSettingsView } from './WalletSettingsView';

// Right panel of the /wallet workspace — renders the section named by the URL.
//
// Each section decides for itself whether the backend supports it, so a deep link to a section this wallet
// cannot serve explains itself rather than 404ing. The nav simply hides those entries.

export const WalletView = () => {
  const section = useWalletSection();

  switch (section) {
    case 'receive':
      return <ReceiveView />;
    case 'send':
      return <SendView />;
    case 'transactions':
      return <TransactionsView />;
    case 'coins':
      return <CoinsView />;
    case 'lightning':
      return <LightningView />;
    case 'settings':
      return <WalletSettingsView />;
    default:
      return <OverviewView />;
  }
};
