import 'package:flutter/material.dart';
import '../../domain/entities/avatar_config.dart';

class AvatarRenderer extends StatelessWidget {
  final AvatarConfig config;
  final double size;

  const AvatarRenderer({
    super.key,
    required this.config,
    this.size = 120.0,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      width: size,
      height: size,
      decoration: BoxDecoration(
        shape: BoxShape.circle,
        boxShadow: [
          BoxShadow(
            color: Colors.black.withValues(alpha: 0.3),
            blurRadius: 10,
            spreadRadius: 2,
          ),
        ],
      ),
      child: Image.asset(
        config.assetPath,
        fit: BoxFit.contain,
        errorBuilder: (c, o, s) => Container(
          decoration: BoxDecoration(
            color: Colors.grey[800],
            shape: BoxShape.circle,
          ),
          child: const Icon(Icons.person, color: Colors.white54),
        ),
      ),
    );
  }
}
