import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:go_router/go_router.dart';

import '../../models/am_registration_data.dart';
import '../../widgets/presentation_form_screen.dart';
import '../../models/card_assets.dart';

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

  @override
  Widget build(BuildContext context) {
    final data = Provider.of<AmRegistrationData>(context, listen: false);
    
    return PresentationFormScreen(
      stepText: 'Étape 3/4',
      title: 'Présentation et Conditions',
      cardColor: CardColorHorizontal.peach,
      textFieldHint: 'Ex: Disponible immédiatement, 10 ans d\'expérience, formation premiers secours...',
      initialText: data.presentationText,
      initialCguAccepted: data.cguAccepted,
      previousRoute: '/am-register-step2',
      onSubmit: (text, cguAccepted) {
        data.updatePresentationAndCgu(
          presentationText: text,
          cguAccepted: cguAccepted,
        );
        context.go('/am-register-step4');
      },
    );
  }
}
