import 'package:cims_apps/application/component/button/back_button_view.dart';
import 'package:cims_apps/application/component/button/button_view.dart';
import 'package:cims_apps/application/component/risk_profile.dart';
import 'package:cims_apps/application/theme/color_palette.dart';
import 'package:cims_apps/core/route/route.dart';
import 'package:cims_apps/core/utils/size_config.dart';
import 'package:cims_apps/features/auth/registration/view/submission_data/risk_profile/question_view.dart';
import 'package:cims_apps/features/auth/registration/view/submission_data/risk_profile/risk_profile_view.dart';
import 'package:cims_apps/features/auth/registration/view/submission_data/risk_profile/risk_profile_view_model/risk_profile_view_model.dart';
import 'package:cims_apps/features/auth/registration/view/submission_data/terms_and_condition/terms_and_condition_view.dart';
import 'package:flutter/material.dart';

class ResultsView extends StatelessWidget {
  final int totalScore;
  final RiskProfileResult typeResult;
  const ResultsView(
      {super.key, required this.typeResult, required this.totalScore});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        toolbarHeight: 70,
        backgroundColor: Colors.white,
        surfaceTintColor: Colors.white,
        automaticallyImplyLeading: false,
        title: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            const BackButtonView(),
            const Text('Risk Profile', textAlign: TextAlign.center),
            SizedBox(width: SizeConfig.width * 0.1)
          ],
        ),
        shape: const RoundedRectangleBorder(
            side: BorderSide(color: ColorPalette.slate200)),
      ),
      body: SingleChildScrollView(
        padding: const EdgeInsets.all(24),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            RiskProfile(totalScore: totalScore, rowSuitableProduct: false),
            const SizedBox(
              height: 32,
            ),
            ButtonView(
              name: 'Re-test',
              onPressed: () {
                routePush(context, page: QuestionView(), routeType: RouteType.pushReplace);
              },
              marginVertical: 0,
              backgroundColor: ColorPalette.white,
              textColor: ColorPalette.primary,
              borderColor: ColorPalette.primary,
              isOutlined: true,
              textSize: 16,
              heightWrapContent: true,
              contentPadding: const EdgeInsets.all(16),
              width: SizeConfig.width,
            ),
            const SizedBox(
              height: 16,
            ),
            ButtonView(
              name: 'Confirm',
              onPressed: () {
                routePush(
                  context,
                  page: const TermsAndConditionView(),
                  routeType: RouteType.pushReplace,
                );
              },
              marginVertical: 0,
              textSize: 16,
              heightWrapContent: true,
              contentPadding: const EdgeInsets.all(16),
              width: SizeConfig.width,
            )
          ],
        ),
      ),
    );
  }
}
