import React from 'react' import { Box, Text } from '@anthropic/ink' import type { MoveOption } from '../battle/types' export interface BattleMenuProps { phase: 'main' | 'fight' moves: MoveOption[] cursorIndex: number onMoveCursor: (direction: 'up' | 'down' | 'left' | 'right') => void onSelect: () => void onBack: () => void } export function BattleMenu({ phase, moves, cursorIndex }: BattleMenuProps) { if (phase === 'fight') { return } return } function MainMenu({ cursorIndex }: { cursorIndex: number }) { return ( {/* Row 0: 战斗 + 背包 */} {/* Row 1: 宝可梦 + 逃跑 */} ) } function MenuItem({ label, selected, disabled }: { label: string; selected: boolean; disabled?: boolean }) { if (selected && disabled) { return ( {' ▶ '}{label} (不可用) ) } if (selected) { return ( {' ▶ '}{label} ) } if (disabled) { return ( {' '}{label} ) } return ( {' '}{label} ) } function MoveMenu({ moves, cursorIndex }: { moves: MoveOption[]; cursorIndex: number }) { return ( {moves.map((move, i) => ( ))} ) } function MoveItem({ move, selected }: { move: MoveOption; selected: boolean }) { const ppText = `PP ${move.pp}/${move.maxPp}` const noPP = move.pp <= 0 || move.disabled if (selected) { return ( {' ▶ '}{move.name.padEnd(14)}{ppText} ) } return ( {' '}{move.name.padEnd(14)}{ppText} {move.disabled && 禁用} ) }