import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:tanami_app/core/routes/route_name.dart';
import 'package:tanami_app/core/routes/routes.dart';
import 'package:tanami_app/core/styles/app_color.dart';
import 'package:tanami_app/core/styles/app_text.dart';
import 'package:tanami_app/shared/components/button_widget.dart';

import '../../../../../shared/components/appbar_widget.dart';
import '../../../Portfolio/presentation/bloc/carousel/carousel_bloc.dart';
import 'invest_details_layout.dart';

class InvestDetailsScreen extends StatelessWidget {
  final String type;
  const InvestDetailsScreen({super.key, required this.type});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: AppColor.plainWhite,
      bottomNavigationBar: type == "closed"
          ? null
          : Container(
              margin: const EdgeInsets.all(10),
              width: 1.sw,
              height: 65.h,
              child: ButtonWidget().elevatedBtn(
                text: AppText.investText,
                clr: AppColor.primaryColor2,
                function: () {
                  goRouter.pushNamed(RouteName.investPaymentScreen);
                },
              ),
            ),
      appBar: const AppBarWidget(
        height: 45,
        titleTxt: "",
      ),
      body: MultiBlocProvider(
        providers: [
          BlocProvider(
            // Create an instance of the OnboardingBloc
            create: (context) => CarouselBloc(),
          ),
        ],
        child: InvestDetailsLayout(
          type: type,
        ),
      ),
    );
  }
}
