import 'package:cs_resources/generated/l10n.dart';
import 'package:cs_resources/theme/app_colors_theme.dart';
import 'package:domain/entity/facility_page_entity.dart';
import 'package:flutter/material.dart';
import 'package:widgets/ext/ex_widget.dart';
import 'package:widgets/my_text_view.dart';

///  设施的Deposit的Item
class FacilityDepositItem extends StatelessWidget {
  final int index;
  final FacilityDetail item;

  const FacilityDepositItem({
    required this.index,
    required this.item,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      color: context.appColors.whiteBG,
      margin: const EdgeInsets.only(top: 5),
      padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 23),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          MyTextView(
            "${item.facility?.type?.name ?? ""} ${item.facility?.name ?? ""}",
            fontSize: 16,
            textColor: context.appColors.textPrimary,
            isFontMedium: true,
          ),
          Row(
            children: [
              MyTextView(
                S.current.deposit_hold,
                fontSize: 14.5,
                textColor: context.appColors.textBlack,
                isFontMedium: true,
              ),
              const Spacer(),
              MyTextView(
                "\$${item.booking?.deposit ?? ""}",
                fontSize: 14.5,
                textColor: context.appColors.textBlack,
                isFontMedium: true,
              ),
            ],
          ).marginOnly(top: 10),
        ],
      ),
    );
  }
}
