import 'package:cims_apps/application/assets/path_assets.dart';
import 'package:cims_apps/application/component/card_transaction/card_transaction_view.dart';
import 'package:cims_apps/application/component/card_transaction/empty_card_transaction.dart';
import 'package:cims_apps/core/utils/number_formatter.dart';
import 'package:cims_apps/core/utils/string_utils.dart';
import 'package:cims_apps/features/transaction/viewmodel/transaction_viewmodel.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class WaitingView extends StatelessWidget {
  const WaitingView({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return SingleChildScrollView(
      child:
          Consumer<TransactionViewModel>(builder: (context, provider, child) {
        return Column(
          children: [
            provider.listWaitingTransaction.isNotEmpty
                ? CardTransactionView(
                    onTap: () {},
                    iconPath: PathAssets.iconEducation,
                    type: 'Education',
                    amount: NumberFormatter.numberCurrency(
                      6000000,
                      'Rp ',
                      'id_ID',
                      decimalDigits: 0,
                    ),
                    timeTransaction: StringUtils.formatTime(DateTime.now()),
                    subs: '3 Subscription',
                    step: 'waiting')
                : EmptyCardTransaction(
                    onPressedButton: () {},
                  ),
          ],
        );
      }),
    );
  }
}
