/// Price Negotiation Section Widget
///
/// Optional price negotiation checkbox.
library;

import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:worker/core/constants/ui_constants.dart';
import 'package:worker/core/theme/colors.dart';

/// Price Negotiation Section
///
/// Allows user to request price negotiation instead of direct order.
class PriceNegotiationSection extends HookWidget {

  const PriceNegotiationSection({super.key, required this.ignorePricingRule});
  final ValueNotifier<bool> ignorePricingRule;

  @override
  Widget build(BuildContext context) {
    final colorScheme = Theme.of(context).colorScheme;

    return Container(
      margin: const EdgeInsets.symmetric(horizontal: AppSpacing.md),
      padding: const EdgeInsets.all(AppSpacing.md),
      decoration: BoxDecoration(
        color: const Color(0xFFFFF8E1),
        borderRadius: BorderRadius.circular(AppRadius.card),
        border: Border.all(color: const Color(0xFFFFD54F)),
      ),
      child: Row(
        children: [
          Checkbox(
            value: ignorePricingRule.value,
            onChanged: (value) {
              ignorePricingRule.value = value ?? false;
            },
            activeColor: AppColors.warning,
          ),
          Expanded(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  'Đàm phán giá',
                  style: TextStyle(
                    fontSize: 15,
                    fontWeight: FontWeight.w600,
                    color: colorScheme.onSurface,
                  ),
                ),
                const SizedBox(height: 4),
                Text(
                  'Gửi yêu cầu đàm phán giá cho đơn hàng này',
                  style: TextStyle(
                    fontSize: 13,
                    color: colorScheme.onSurfaceVariant,
                  ),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
