import 'package:flutter/material.dart';

import 'package:pshared/models/payment/quote/status_type.dart';
import 'package:pshared/models/auto_refresh_mode.dart';

import 'package:pweb/pages/dashboard/payouts/quote_status/widgets/refresh_section.dart';
import 'package:pweb/pages/dashboard/payouts/quote_status/widgets/card.dart';


class QuoteStatusBody extends StatelessWidget {
  final double spacing;
  final QuoteStatusType statusType;
  final String statusText;
  final String? helperText;
  final bool isLoading;
  final bool canRefresh;
  final bool showPrimaryRefresh;
  final AutoRefreshMode autoRefreshMode;
  final ValueChanged<AutoRefreshMode> onAutoRefreshModeChanged;
  final VoidCallback onRefresh;

  const QuoteStatusBody({
    super.key,
    required this.spacing,
    required this.statusType,
    required this.statusText,
    required this.helperText,
    required this.isLoading,
    required this.canRefresh,
    required this.showPrimaryRefresh,
    required this.autoRefreshMode,
    required this.onAutoRefreshModeChanged,
    required this.onRefresh,
  });

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        QuoteStatusCard(
          statusType: statusType,
          isLoading: isLoading,
          statusText: statusText,
          helperText: helperText,
          canRefresh: canRefresh,
          showPrimaryRefresh: showPrimaryRefresh,
          onRefresh: onRefresh,
        ),
        SizedBox(height: spacing),
        QuoteAutoRefreshSection(
          autoRefreshMode: autoRefreshMode,
          canRefresh: canRefresh,
          onModeChanged: onAutoRefreshModeChanged,
        ),
      ],
    );
  }
}
