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/flutter_svg.dart';

class CompleteResultWidget extends StatelessWidget {
  final String? currentLevel;
  final int? score;
  final String stdLearningId;
  final String topicId;
  final String topicTitle;

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

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Text(
          'GREAT WORK',
          style: AppTextStyles.blueTextStyle.copyWith(
            fontSize: 25,
            fontWeight: FontWeight.w900,
          ),
        ),
        const SizedBox(height: 24),
        SvgPicture.asset(
          'lib/features/learning/modules/result/assets/images/result_complete_illustration.svg',
          width: 259,
        ),
        const SizedBox(height: 24),
        Text(
          'Congratulations!',
          style: AppTextStyles.disableTextStyle.copyWith(
            fontSize: 14,
            fontWeight: FontWeight.w400,
          ),
        ),
        const SizedBox(height: 12),
        Text(
          'Way to go! You conquered LEVEL $currentLevel with a $score/100! You\'re a rock star!',
          style: AppTextStyles.disableTextStyle.copyWith(
            fontSize: 14,
            fontWeight: FontWeight.w400,
          ),
        ),
        const SizedBox(height: 24),
        GlobalButton(
          text: 'Discover More',
          onPressed: () {
            Navigator.pushReplacement(
              context,
              MaterialPageRoute(
                builder: (context) => FeedbackScreen(
                  stdLearningId: stdLearningId,
                  topicId: topicId, // Tambahkan ini
                  topicTitle: topicTitle, // Tambahkan ini
                ),
              ),
            );
          },
        )
      ],
    );
  }
}
