import 'package:flutter/material.dart'; import '../../../models/log_entry.dart'; import '../../../theme/app_theme.dart'; class UserMessageCard extends StatelessWidget { final UserEntry entry; final int index; const UserMessageCard({super.key, required this.entry, required this.index}); @override Widget build(BuildContext context) { return Container( decoration: BoxDecoration( color: AppColors.userBg, borderRadius: BorderRadius.circular(8), border: Border.all(color: AppColors.user.withAlpha(40)), ), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ // Header Padding( padding: const EdgeInsets.fromLTRB(14, 10, 14, 8), child: Row( children: [ Container( width: 22, height: 22, decoration: BoxDecoration( color: AppColors.user.withAlpha(40), borderRadius: BorderRadius.circular(4), ), child: const Icon(Icons.person, size: 14, color: AppColors.user), ), const SizedBox(width: 8), const Text( 'User', style: TextStyle( fontSize: 12, fontWeight: FontWeight.w600, color: AppColors.user, ), ), const SizedBox(width: 8), Text( '#$index', style: const TextStyle(fontSize: 11, color: AppColors.textMuted), ), const Spacer(), if (entry.timestamp != null) Text( _formatTime(entry.timestamp!), style: const TextStyle(fontSize: 11, color: AppColors.textMuted), ), ], ), ), // Content Padding( padding: const EdgeInsets.fromLTRB(14, 0, 14, 12), child: SelectableText( entry.promptText, style: const TextStyle( fontSize: 13, color: AppColors.textPrimary, height: 1.5, ), ), ), ], ), ); } String _formatTime(DateTime dt) { return '${dt.hour.toString().padLeft(2, '0')}:' '${dt.minute.toString().padLeft(2, '0')}:' '${dt.second.toString().padLeft(2, '0')}'; } }