import 'package:flutter/material.dart';

class BattleLogOverlay extends StatelessWidget {
  final List<String> logs;

  const BattleLogOverlay({super.key, required this.logs});

  @override
  Widget build(BuildContext context) {
    if (logs.isEmpty) return const SizedBox.shrink();

    return Container(
      padding: const EdgeInsets.all(8.0),
      decoration: BoxDecoration(
        color: Colors.black54,
        borderRadius: BorderRadius.circular(8),
      ),
      child: ListView.builder(
        reverse: true,
        itemCount: logs.length,
        itemBuilder: (context, index) {
          final logIndex = logs.length - 1 - index;
          return Text(
            logs[logIndex],
            style: const TextStyle(color: Colors.white70, fontSize: 12),
          );
        },
      ),
    );
  }
}
