import 'package:english_learning/core/utils/styles/theme.dart';
import 'package:english_learning/core/widgets/global_button.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

class IncompleteSubmission extends StatelessWidget {
  final VoidCallback onCheckAgain;
  final VoidCallback onSubmit;

  const IncompleteSubmission({
    super.key,
    required this.onCheckAgain,
    required this.onSubmit,
  });

  @override
  Widget build(BuildContext context) {
    return Dialog(
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(20),
      ),
      child: Container(
        decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.circular(20),
        ),
        child: Padding(
          padding: const EdgeInsets.symmetric(
            horizontal: 18.0,
            vertical: 24.0,
          ),
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              RichText(
                text: TextSpan(children: [
                  TextSpan(
                    text: 'Incomplete',
                    style: AppTextStyles.redTextStyle.copyWith(
                      fontSize: 18,
                      fontWeight: FontWeight.w900,
                    ),
                  ),
                  TextSpan(
                    text: ' Submission!',
                    style: AppTextStyles.blackTextStyle.copyWith(
                      fontSize: 18,
                      fontWeight: FontWeight.w900,
                    ),
                  ),
                ]),
              ),
              const SizedBox(height: 20),
              SvgPicture.asset(
                'lib/features/learning/modules/exercises/assets/images/incomplete_illustration.svg',
                width: 160,
              ),
              const SizedBox(height: 20),
              Text(
                'Looks like a few questions might have been missed. Would you like to review them?',
                textAlign: TextAlign.center,
                style: AppTextStyles.disableTextStyle.copyWith(
                  fontSize: 12,
                  fontWeight: FontWeight.w500,
                ),
              ),
              const SizedBox(height: 24),
              Row(
                children: [
                  Expanded(
                    child: GlobalButton(
                      text: 'Check Again',
                      textColor: AppColors.blueColor,
                      borderColor: AppColors.blueColor,
                      backgroundColor: Colors.transparent,
                      onPressed: () {
                        onCheckAgain();
                      },
                    ),
                  ),
                  const SizedBox(width: 10),
                  Expanded(
                    child: GlobalButton(
                      text: 'Submit',
                      backgroundColor: AppColors.redColor,
                      onPressed: onSubmit,
                    ),
                  )
                ],
              ),
            ],
          ),
        ),
      ),
    );
  }
}
