import 'package:flutter/material.dart';

import 'package:asciineverdie/l10n/app_localizations.dart';
import 'package:asciineverdie/src/features/game/widgets/combat_log.dart';

/// 전투 로그 페이지 (캐로셀)
///
/// 전투 이벤트 로그 표시.
class CombatLogPage extends StatelessWidget {
  const CombatLogPage({super.key, required this.entries});

  final List<CombatLogEntry> entries;

  @override
  Widget build(BuildContext context) {
    final localizations = L10n.of(context);

    return Column(
      crossAxisAlignment: CrossAxisAlignment.stretch,
      children: [
        // 헤더
        _buildSectionHeader(context, localizations.combatLog),

        // 로그 (CombatLog 재사용)
        Expanded(child: CombatLog(entries: entries)),
      ],
    );
  }

  Widget _buildSectionHeader(BuildContext context, String title) {
    return Container(
      padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
      color: Theme.of(context).colorScheme.primaryContainer,
      child: Text(
        title,
        style: TextStyle(
          fontWeight: FontWeight.bold,
          fontSize: 18,
          color: Theme.of(context).colorScheme.onPrimaryContainer,
        ),
      ),
    );
  }
}
