import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
import 'package:taafee_mobile/common/const/const.dart';
import 'package:taafee_mobile/common/widgets/text.dart';
import 'package:taafee_mobile/features/card/presentation_layer/widgets/card_header.dart';
import 'package:taafee_mobile/features/favorite/data_layer/model/favorite.dart';

class FavoriteCardWidget extends StatelessWidget {
  final FavoriteModel favoriteModel;
  const FavoriteCardWidget({super.key, required this.favoriteModel});

  @override
  Widget build(BuildContext context) {
    return Container(
        color: Colors.white,
        width: Get.width * .44,
        height: 150,
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            CardHeaderWidget(
              cardModel: favoriteModel.cardModel,
              isFavoriteCardWidget: true,
            ),
            const SizedBox(
              height: 10,
            ),
            Row(
              children: [
                SvgPicture.asset("assets/icons/love-svgrepo-com 2.svg"),
                MediumTextWidget(
                    " ${'${favoriteModel.cardModel.user.firstName} ${favoriteModel.cardModel.user.lastName}'}"),
              ],
            ).paddingSymmetric(horizontal: 10),
            const SizedBox(
              height: 10,
            ),
            SizedBox(
              width: Responsive.isTablet() ? Get.width : null,
              child: Row(
                children: [
                  SvgPicture.asset(
                    "assets/icons/phone.svg",
                  ),
                  MediumTextWidget(" ${favoriteModel.cardModel.phoneNumber}")
                ],
              ).paddingSymmetric(horizontal: 13),
            ),
            const SizedBox(
              height: 10,
            ),
            SizedBox(
              width: Responsive.isTablet() ? Get.width : null,
              child: Row(
                children: [
                  SvgPicture.asset(
                    "assets/icons/location.svg",
                  ),
                  SizedBox(
                    width: Responsive.isTablet()
                        ? Get.width * 0.2
                        : Get.width * 0.3,
                    child: MediumTextWidget(
                      " ${favoriteModel.cardModel.cityModel.name} , ${favoriteModel.cardModel.cityModel.country}",
                      overflow: TextOverflow.ellipsis,
                    ),
                  ),
                ],
              ).paddingOnly(left: 8),
            ),
          ],
        ).paddingOnly(bottom: 4));
  }
}
