import 'package:english_learning/core/utils/styles/theme.dart';
import 'package:english_learning/core/widgets/global_button.dart';
import 'package:english_learning/features/learning/modules/feedback/screens/feedback_screen.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';

class JumpResultWidget extends StatelessWidget {
  final String? nextLevel;
  final int? score;
  final String stdLearningId;
  final String topicId;
  final String topicTitle;

  const JumpResultWidget({
    super.key,
    required this.nextLevel,
    required this.score,
    required this.stdLearningId,
    required this.topicId,
    required this.topicTitle,
  });

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            Text(
              'Your Result',
              style: AppTextStyles.blackTextStyle.copyWith(
                fontSize: 25,
                fontWeight: FontWeight.w900,
              ),
            ),
            Text(
              '$score/100',
              style: AppTextStyles.blueTextStyle.copyWith(
                fontSize: 20,
                fontWeight: FontWeight.w900,
              ),
            ),
          ],
        ),
        const SizedBox(height: 24),
        SvgPicture.asset(
          'lib/features/learning/modules/result/assets/images/result_jump_illustration.svg',
          width: 259,
        ),
        const SizedBox(height: 24),
        Text(
          'Great job! You can jump to ...',
          style: AppTextStyles.disableTextStyle.copyWith(
            fontSize: 14,
            fontWeight: FontWeight.w400,
          ),
        ),
        const SizedBox(height: 8),
        Text(
          '$nextLevel',
          style: AppTextStyles.blueTextStyle
              .copyWith(fontSize: 20, fontWeight: FontWeight.w900),
        ),
        const SizedBox(height: 24),
        GlobalButton(
          text: 'Continue',
          onPressed: () {
            Navigator.pushReplacement(
              context,
              MaterialPageRoute(
                builder: (context) => FeedbackScreen(
                  stdLearningId: stdLearningId,
                  topicId: topicId, // Tambahkan ini
                  topicTitle: topicTitle, // Tambahkan ini
                ),
              ),
            );
          },
        )
      ],
    );
  }
}
