import 'package:flutter/material.dart';
import 'package:niogu_app/core/constants/app_color.dart';
import 'package:niogu_app/core/constants/app_font_size.dart';
import 'package:niogu_app/features/report/transaction/domain/entities/transaction_report.dart';
import 'package:sizer/sizer.dart';

class BrandOrderHeader extends StatelessWidget {
  final OrderDetail orderDetail;

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

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: EdgeInsets.symmetric(vertical: 3.h),
      child: Column(
        children: [
          Container(
            width: 16.w,
            height: 16.w,
            decoration: BoxDecoration(
              shape: BoxShape.circle,
              color: Colors.grey[100],
              border: Border.all(color: Colors.grey.shade200),
            ),
            child: orderDetail.localPhotoPath != null
                ? ClipOval(
                    child: Image.network(
                      orderDetail.localPhotoPath!,
                      fit: BoxFit.cover,
                      errorBuilder: (_, __, ___) => Icon(
                        Icons.store,
                        color: AppColor.primaryColor,
                        size: 8.w,
                      ),
                    ),
                  )
                : Icon(
                    Icons.store_rounded,
                    color: AppColor.primaryColor,
                    size: 8.w,
                  ),
          ),
          SizedBox(height: 1.5.h),

          // Nama Toko
          Text(
            orderDetail.outletName,
            style: TextStyle(
              fontSize: AppFontSize.medium.sp,
              fontWeight: FontWeight.bold,
              color: Colors.black87,
            ),
          ),

          SizedBox(height: 0.5.h),
          Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text(
                "Powered by ",
                style: TextStyle(
                  fontSize: (AppFontSize.small - 2).sp,
                  color: Colors.grey[500],
                ),
              ),
              Text(
                "Niogu",
                style: TextStyle(
                  fontSize: (AppFontSize.small - 2).sp,
                  fontWeight: FontWeight.bold,
                  color: AppColor.primaryColor.withOpacity(0.7),
                ),
              ),
            ],
          ),
        ],
      ),
    );
  }
}