import 'package:flutter/material.dart'; import '../theme/app_theme.dart'; /// Shown when market is the only enabled source but no market question is ready. class MarketQuestionPlaceholder extends StatelessWidget { const MarketQuestionPlaceholder({ super.key, this.onRetry, this.busy = false, }); final VoidCallback? onRetry; final bool busy; @override Widget build(BuildContext context) { return Center( child: ConstrainedBox( constraints: const BoxConstraints(maxWidth: 360), child: Padding( padding: const EdgeInsets.all(24), child: Column( mainAxisSize: MainAxisSize.min, children: [ Icon( Icons.show_chart, size: 56, color: AppColors.accent.withValues(alpha: 0.85), ), const SizedBox(height: 16), Text( 'No market question ready', style: Theme.of(context).textTheme.titleLarge, textAlign: TextAlign.center, ), const SizedBox(height: 8), Text( 'Spelling is turned off. A new market question will appear when ' 'prospective data is available—try again in a moment.', style: Theme.of(context).textTheme.bodyLarge, textAlign: TextAlign.center, ), if (onRetry != null) ...[ const SizedBox(height: 20), FilledButton.icon( key: const Key('market-placeholder-retry'), onPressed: busy ? null : onRetry, icon: busy ? const SizedBox( width: 18, height: 18, child: CircularProgressIndicator(strokeWidth: 2), ) : const Icon(Icons.refresh, size: 18), label: const Text('Try again'), ), ], ], ), ), ), ); } }