import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:kasy_kit/core/theme/theme.dart';

typedef PremiumWideBannerOnTap = void Function();

class PremiumWideBanner extends StatelessWidget {
  final Color bgColor;
  final String imagePath;
  final String smallText;
  final String title;
  final PremiumWideBannerOnTap onTap;

  const PremiumWideBanner({
    super.key,
    required this.bgColor,
    required this.imagePath,
    required this.smallText,
    required this.title,
    required this.onTap,
  });

  @override
  Widget build(BuildContext context) {
    return LayoutBuilder(builder: (context, constraints) {
      return Material(
        color: Colors.transparent,
        child: Ink(
          // height: 116,
          width: constraints.maxWidth,
          decoration: BoxDecoration(
            color: bgColor,
            // border: Border.all(color: borderColor),
          ),
          child: InkWell(
            onTap: () => onTap(),
            child: Row(
              children: [
                Image.asset(
                  imagePath,
                  width: constraints.maxWidth * 0.32,
                  // height: 116,
                  fit: BoxFit.cover,
                ),
                const SizedBox(width: KasySpacing.lg),
                Expanded(
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      Text(
                        smallText.toUpperCase(),
                        style: GoogleFonts.albertSans(
                          fontSize: 12,
                          fontWeight: FontWeight.w700,
                          color: context.colors.premiumBannerText,
                        ),
                      ),
                      const SizedBox(height: KasySpacing.sm),
                      Text(
                        title,
                        style: GoogleFonts.albertSans(
                          fontSize: 20,
                          fontWeight: FontWeight.w400,
                          color: context.colors.onPrimary,
                        ),
                        overflow: TextOverflow.clip,
                      ),
                    ],
                  ),
                ),
                const SizedBox(width: KasySpacing.lg),
              ],
            ),
          ),
        ),
      );
    });
  }
}
