import 'package:flutter/material.dart';

import 'package:pweb/pages/invitations/widgets/form/view.dart';


class InvitationsForm extends StatelessWidget {
  final GlobalKey<FormState> formKey;
  final TextEditingController emailController;
  final TextEditingController firstNameController;
  final TextEditingController lastNameController;
  final TextEditingController messageController;
  final bool canCreateRoles;
  final int expiryDays;
  final ValueChanged<int> onExpiryChanged;
  final String? selectedRoleRef;
  final ValueChanged<String?> onRoleChanged;
  final bool canCreate;
  final VoidCallback onSubmit;

  const InvitationsForm({
    super.key,
    required this.formKey,
    required this.emailController,
    required this.firstNameController,
    required this.lastNameController,
    required this.messageController,
    required this.canCreateRoles,
    required this.expiryDays,
    required this.onExpiryChanged,
    required this.selectedRoleRef,
    required this.onRoleChanged,
    required this.canCreate,
    required this.onSubmit,
  });

  @override
  Widget build(BuildContext context) => InvitationFormView(
    formKey: formKey,
    emailController: emailController,
    firstNameController: firstNameController,
    lastNameController: lastNameController,
    messageController: messageController,
    expiryDays: expiryDays,
    onExpiryChanged: onExpiryChanged,
    selectedRoleRef: selectedRoleRef,
    onRoleChanged: onRoleChanged,
    canCreate: canCreate,
    onSubmit: onSubmit,
  );
}
