import 'package:flutter/material.dart';

import '../../theme/theme_extension.dart';

class AdminSectionCard extends StatelessWidget {
  const AdminSectionCard({
    super.key,
    required this.icon,
    required this.title,
    required this.subtitle,
    required this.count,
    required this.onTap,
  });

  final IconData icon;
  final String title;
  final String subtitle;
  final int count;
  final VoidCallback onTap;

  @override
  Widget build(BuildContext context) {
    final fs = Theme.of(context).extension<FabledSwordTheme>()!;
    return Card(
      color: fs.iron,
      margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
      child: ListTile(
        leading: Icon(icon, color: fs.parchment),
        title: Text(
          title,
          style: TextStyle(
            color: fs.parchment,
            fontFamily: 'Fraunces',
            fontSize: 18,
          ),
        ),
        subtitle: Text(subtitle, style: TextStyle(color: fs.ash)),
        trailing: Container(
          padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
          decoration: BoxDecoration(
            color: fs.bronze,
            borderRadius: BorderRadius.circular(12),
          ),
          child: Text(
            '$count',
            style: TextStyle(color: fs.obsidian, fontWeight: FontWeight.w500),
          ),
        ),
        onTap: onTap,
      ),
    );
  }
}
