import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';

import '../../../../../../common/theme/theme.dart';
import '../../../../../router/app_router.gr.dart';
import 'popular_merchant_card.dart';

class HomePopularMerchantSection extends StatelessWidget {
  const HomePopularMerchantSection({super.key});

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
      child: Column(
        children: [
          Row(
            children: [
              Text(
                'Popular Merchants',
                style: AppStyle.xl.copyWith(fontWeight: FontWeight.bold),
              ),
              Spacer(),
              InkWell(
                onTap: () => context.router.push(MerchantRoute()),
                child: Row(
                  children: [
                    Text(
                      'Lihat Semua',
                      style: AppStyle.sm.copyWith(
                        fontWeight: FontWeight.w500,
                        color: AppColor.primary,
                      ),
                    ),
                    SizedBox(width: 4),
                    Icon(
                      Icons.arrow_forward_ios,
                      size: 12,
                      color: AppColor.primary,
                    ),
                  ],
                ),
              ),
            ],
          ),
          SizedBox(height: 16),
          HomePopularMerchantCard(
            merchantName: 'Warung Bu Sari',
            merchantImage: 'https://via.placeholder.com/280x160',
            category: 'Indonesian Food',
            rating: 4.8,
            distance: '0.5 km',
            isOpen: true,
            onTap: () {
              print('Warung Bu Sari tapped');
            },
          ),

          HomePopularMerchantCard(
            merchantName: 'Pizza Corner',
            merchantImage: 'https://via.placeholder.com/280x160',
            category: 'Italian Food',
            rating: 4.6,
            distance: '1.2 km',
            isOpen: false,
            onTap: () {
              print('Pizza Corner tapped');
            },
          ),

          HomePopularMerchantCard(
            merchantName: 'Kopi Kenangan',
            merchantImage: 'https://via.placeholder.com/280x160',
            category: 'Coffee & Drinks',
            rating: 4.9,
            distance: '0.8 km',
            isOpen: true,
            onTap: () {
              print('Kopi Kenangan tapped');
            },
          ),
        ],
      ),
    );
  }
}
