import 'package:flutter/material.dart';
import 'package:test_sa/controllers/providers/api/device_transfer_provider.dart';
import 'package:test_sa/extensions/context_extension.dart';
import 'package:test_sa/extensions/int_extensions.dart';
import 'package:test_sa/extensions/string_extensions.dart';
import 'package:test_sa/extensions/text_extensions.dart';
import 'package:test_sa/extensions/widget_extensions.dart';
import 'package:test_sa/modules/asset_delivery_module/models/asset_delivery_data_model.dart';
import 'package:test_sa/new_views/app_style/app_color.dart';
import 'package:test_sa/views/widgets/item_views/info_text_widget.dart';
import 'package:test_sa/views/widgets/requests/request_status.dart';

class AssetDeliveryTableCard extends StatelessWidget {
  AssetDeliveryTableModel deliveryTableModel;
  VoidCallback onCardTap;
  VoidCallback onViewHistoryTap;

  AssetDeliveryTableCard({
    super.key,
    required this.deliveryTableModel,
    required this.onCardTap,
    required this.onViewHistoryTap,
  });

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        StatusLabel(
          label: deliveryTableModel.status?.name,
          textColor: AppColor.neutral50,
          backgroundColor: AppColor.orange30,
        ),
        // Row(
        //   mainAxisAlignment: MainAxisAlignment.spaceBetween,
        //   children: [
        //     StatusLabel(
        //       label: deliveryTableModel.status?.name,
        //       textColor: AppColor.neutral50,
        //       backgroundColor: AppColor.orange30,
        //     ),
        //     Row(
        //       children: [
        //         'history_icon'.toSvgAsset(height: 14, width: 14),
        //         8.width,
        //         Text(
        //           'View History'.addTranslation,
        //           style: AppTextStyles.bodyText.copyWith(color: AppColor.primary10),
        //         ),
        //       ],
        //     ).onPress(() {
        //       onViewHistoryTap();
        //     }),
        //   ],
        // ),
        8.height,
        InfoTextWidget(label: "Delivery Number", value: deliveryTableModel.number ?? '-'),
        InfoTextWidget(label: "Delivery Amount", value: deliveryTableModel.deliveryAmount?.toString() ?? '-'),
        InfoTextWidget(label: "Invoice Amount", value: deliveryTableModel.invoiceAmount?.toString() ?? '-', showArrow: true),
      ],
    ).toShadowContainer(context).onPress(() {
      onCardTap();
    });
  }
}
