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

import '../../../../../application/auth/register_form/register_form_bloc.dart';
import '../../../../components/field/field.dart';

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

  @override
  Widget build(BuildContext context) {
    return DatePickerField(
      label: 'Masukkan tanggal lahir',
      onDateSelected: (value) {
        context.read<RegisterFormBloc>().add(
          RegisterFormEvent.birthDateChanged(value),
        );
      },
    );
  }
}
