import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';

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

  final String title;
  final String icon;
  final VoidCallback? onTap;

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: onTap,
      child: Card(
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(8),
          side: const BorderSide(color: AppColor.blueNormal, width: 1),
        ),
        child: Container(
          padding: const EdgeInsets.all(8),
          decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(8),
            color: Colors.white,
          ),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              SvgGenImage(icon).svg(width: 50, height: 50),
              const SizedBox(height: 8),
              Text(
                title,
                style: AppFonts.yekan16.copyWith(color: AppColor.blueNormal),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
