import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:tm_app/core/constants/assets.dart';
import 'package:tm_app/core/theme/colors.dart';
import 'package:tm_app/core/utils/size_config.dart';

import '../../../data/services/model/tender_data/tender_data.dart';
import '../../shared/flag.dart';
import '../strings/tender_details_strings.dart';

class TenderLocationSection extends StatelessWidget {
  final TenderData detail;

  const TenderLocationSection({required this.detail, super.key});

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.symmetric(vertical: 0),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          SizedBox(
            height: 45.0.h(),
            child: Text(
              '',
              style: TextStyle(
                color: AppColors.grey80,
                fontWeight: FontWeight.w600,
                fontSize: 16.0.sp(),
              ),
            ),
          ),
          Row(
            children: [
              SvgPicture.asset(
                AssetsManager.location,
                height: 20.0.h(),
                width: 20.0.w(),
              ),
              SizedBox(width: 4.0.w()),
              Text(
                detail.countryCode ?? '',
                style: TextStyle(
                  color: AppColors.grey70,
                  fontSize: 14.0.sp(),
                  fontWeight: FontWeight.w400,
                ),
              ),
              SizedBox(width: 4.0.w()),
              detail.countryCode != null
                  ? Flag(countryCode: detail.countryCode!)
                  : const Flag(countryCode: ''),
            ],
          ),
          SizedBox(height: 8.0.h()),
          Text(
            TenderDetailsStrings.tenderLocationLabel,
            style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0.sp()),
          ),
          SizedBox(height: 8.0.h()),
          Text(
            detail.description ?? '',
            style: TextStyle(fontWeight: FontWeight.w400, fontSize: 14.0.sp()),
          ),
          SizedBox(height: 16.0.h()),
        ],
      ),
    );
  }
}
