import 'package:flutter/material.dart';

import '../models/wifi_network.dart';
import '../theme/app_colors.dart';

class WifiListTile extends StatelessWidget {
  const WifiListTile({
    required this.network,
    required this.onTap,
    super.key,
  });

  final WifiNetwork network;
  final VoidCallback onTap;

  @override
  Widget build(BuildContext context) {
    return Card(
      child: ListTile(
        onTap: onTap,
        contentPadding: const EdgeInsets.symmetric(
          horizontal: AppSpacing.md,
          vertical: AppSpacing.xs,
        ),
        leading: Container(
          width: 48,
          height: 48,
          decoration: BoxDecoration(
            color: AppColors.info.withValues(alpha: 0.14),
            borderRadius: BorderRadius.circular(AppRadius.medium),
          ),
          child: const Icon(Icons.wifi_rounded, color: AppColors.info),
        ),
        title: Text(network.ssid),
        subtitle: Text('${network.security} · ${network.signalLabel}'),
        trailing: const Icon(Icons.chevron_right_rounded),
      ),
    );
  }
}
