import 'package:flutter/material.dart';
import 'package:tm_app/data/services/model/tender_data/tender_data.dart';
import 'package:tm_app/views/detail/strings/tender_details_strings.dart';
import 'package:tm_app/views/detail/widgets/deadline_item.dart';
import 'package:tm_app/views/detail/widgets/info_item.dart';

class TenderDetailInfoSection extends StatelessWidget {
  final bool isScreenBig;
  final TenderData detail;

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

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        InfoItem(
          title: TenderDetailsStrings.tenderIdLabel,
          value: detail.tenderId ?? '',
        ),
        DeadlineItem(detail: detail, isScreenBig: isScreenBig),
        InfoItem(
          title: TenderDetailsStrings.tenderClientLabel,
          value: detail.buyerOrganization!.name ?? '',
        ),
        InfoItem(
          title: TenderDetailsStrings.estimatedValue,
          value: '${detail.estimatedValue} ${detail.currency ?? ''}',
        ),
        InfoItem(
          title: TenderDetailsStrings.duration,
          value: '${detail.duration} ${detail.durationUnit ?? ''}',
        ),
        InfoItem(
          title: TenderDetailsStrings.tenderReferenceNumberLabel,
          value: detail.noticePublicationId ?? '',
        ),
      ],
    );
  }
}
