import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:gap/gap.dart';
import 'package:krow/core/presentation/gen/assets.gen.dart';
import 'package:krow/core/presentation/styles/kw_text_styles.dart';
import 'package:krow/core/presentation/styles/theme.dart';
import 'package:krow/core/presentation/widgets/ui_kit/kw_input.dart';
import 'package:krow/features/sign_in/domain/bloc/sign_in_bloc.dart';

class EnterNewPassForm extends StatelessWidget {
  final bool obscurePassword;

  const EnterNewPassForm({super.key, required this.obscurePassword});

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        const Gap(36),
        const Text(
          'Reset Your Password',
          style: AppTextStyles.headingH1,
        ),
        const Gap(8),
        Text(
          'Create a new password for your account',
          style:
              AppTextStyles.bodyMediumReg.copyWith(color: AppColors.blackGray),
        ),
        const Gap(24),
        KwTextInput(
            title: 'New Password',
            hintText: 'Enter password here',
            obscureText: obscurePassword,
            maxLines: 1,
            suffixIcon: GestureDetector(
              onTap: () {
                BlocProvider.of<SignInBloc>(context)
                    .add(SwitchObscurePasswordEvent());
              },
              child: Padding(
                padding: const EdgeInsets.only(right: 16),
                child: obscurePassword
                    ? Assets.images.icons.eyeOff.svg()
                    : Assets.images.icons.eye.svg(),
              ),
            ),
            controller: TextEditingController()),
        const Gap(8),
        KwTextInput(
            title: 'Confirm Password',
            hintText: 'Enter password here',
            maxLines: 1,
            obscureText: obscurePassword,
            suffixIcon: GestureDetector(
              onTap: () {
                BlocProvider.of<SignInBloc>(context)
                    .add(SwitchObscurePasswordEvent());
              },
              child: Padding(
                padding: const EdgeInsets.only(right: 16),
                child: obscurePassword
                    ? Assets.images.icons.eyeOff.svg()
                    : Assets.images.icons.eye.svg(),
              ),
            ),
            controller: TextEditingController()),
        const Gap(24),
      ],
    );
  }
}
