import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:niogu_app/core/enums/order_source.dart';
import 'package:niogu_app/core/utils/time_zone.dart';
import 'package:niogu_app/features/report/transaction/domain/entities/transaction_report.dart';
import 'package:niogu_app/features/report/transaction/presentation/widgets/info_row.dart';
import 'package:sizer/sizer.dart';

class GeneralOrderInfo extends StatelessWidget {
  final OrderDetail orderDetail;

  const GeneralOrderInfo({super.key, required this.orderDetail});

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: EdgeInsets.symmetric(horizontal: 5.w, vertical: 2.h),
      child: Column(
        children: [
          InfoRow(
            label: "No. Transaksi",
            value: orderDetail.orderNumber,
            isBoldValue: true,
          ),
          SizedBox(height: 1.h),
          InfoRow(
            label: "Waktu",
            value:
                "${DateFormat("dd MMMM yyyy HH:mm").format(orderDetail.orderDate)} ${TimeZone.getCurrentTimeZone()}",
          ),
          SizedBox(height: 1.h),
          InfoRow(
            label: "Sumber",
            value: orderDetail.orderSource == OrderSource.pos
                ? "Penjualan dari kasir"
                : "Penjualan dari toko online",
          ),
          SizedBox(height: 1.h),
          InfoRow(label: "Kasir", value: orderDetail.userName),
        ],
      ),
    );
  }
}
