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

import '../../../../../common/theme/theme.dart';
import '../../../../components/field/field.dart';
import 'widgets/voucher_card.dart';

@RoutePage()
class VoucherPage extends StatelessWidget {
  const VoucherPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Voucher'),
        automaticallyImplyLeading: false,
        bottom: PreferredSize(
          preferredSize: Size.fromHeight(70),
          child: SearchTextField(
            hintText: 'Punya kode promo? Masukkan disini',
            prefixIcon: Icons.local_offer,
          ),
        ),
      ),
      body: Column(
        children: [
          // Voucher Belanja Section
          Expanded(
            child: Column(
              children: [
                // Section Header
                Padding(
                  padding: EdgeInsets.all(16),
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Text(
                        'Voucher Belanja',
                        style: TextStyle(
                          color: AppColor.textPrimary,
                          fontSize: 18,
                          fontWeight: FontWeight.bold,
                        ),
                      ),
                      Text(
                        '10 voucher',
                        style: TextStyle(
                          color: AppColor.textSecondary,
                          fontSize: 14,
                        ),
                      ),
                    ],
                  ),
                ),

                // Voucher List
                Expanded(
                  child: ListView(
                    padding: EdgeInsets.symmetric(horizontal: 16),
                    children: [
                      VoucherCard(
                        title: 'New User Voucher - Diskon 50% hingga Rp35K',
                        subtitle: 'Tanpa Min. Belanja',
                        expireDate: '25 Sep 2025',
                        minTransaction: '-',
                      ),
                      SizedBox(height: 16),
                      VoucherCard(
                        title: 'New User Voucher - Diskon 35% hingga Rp50K',
                        subtitle: 'Tanpa Min. Belanja',
                        expireDate: '25 Sep 2025',
                        minTransaction: '-',
                      ),
                      SizedBox(height: 16),
                      VoucherCard(
                        title: 'New User Voucher - Diskon 25% hingga Rp50K',
                        subtitle: 'Tanpa Min. Belanja',
                        expireDate: '25 Sep 2025',
                        minTransaction: '-',
                      ),
                      SizedBox(height: 16),
                    ],
                  ),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
