import React from "react";

function IconOrderNumber() {
  return (
    <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
      <path d="M31.6949 7.78153L16.2466 0.0581823C16.17 0.0199194 16.0856 0 16 0C15.9144 0 15.83 0.0199194 15.7534 0.0581823L0.305111 7.78153C0.213397 7.82735 0.136267 7.89783 0.0823747 7.98504C0.0284826 8.07225 -3.95542e-05 8.17276 8.22259e-06 8.27527V23.722C-0.000553999 23.825 0.0277257 23.926 0.0816465 24.0138C0.135567 24.1015 0.212976 24.1724 0.305111 24.2185L15.7534 31.9418C15.83 31.9801 15.9144 32 16 32C16.0856 32 16.17 31.9801 16.2466 31.9418L31.6949 24.2185C31.787 24.1724 31.8644 24.1015 31.9184 24.0138C31.9723 23.926 32.0006 23.825 32 23.722V8.27527C32 8.17276 31.9715 8.07225 31.9176 7.98504C31.8637 7.89783 31.7866 7.82735 31.6949 7.78153ZM16 15.3819L11.6872 13.2254L25.4725 5.9031L30.2174 8.27527L16 15.3819ZM7.27338 11.0187L21.0588 3.69643L24.2588 5.29627L10.475 12.6197L7.27338 11.0187ZM6.62069 11.9262L9.93104 13.5812V17.9769L8.66594 16.7119C8.56249 16.6085 8.42218 16.5503 8.27587 16.5503H6.62069V11.9262ZM16 1.16869L19.8466 3.0896L6.06125 10.413L1.78539 8.27527L16 1.16869ZM1.10346 9.16787L5.51725 11.3745V17.102C5.51725 17.2483 5.57537 17.3886 5.67884 17.492C5.78231 17.5955 5.92264 17.6536 6.06897 17.6536H8.04745L10.0927 19.6987C10.1699 19.7758 10.2681 19.8283 10.3752 19.8496C10.4822 19.8709 10.5931 19.8599 10.6939 19.8182C10.7947 19.7764 10.8808 19.7058 10.9415 19.6151C11.0021 19.5244 11.0345 19.4177 11.0345 19.3086V14.1329L15.4483 16.3396V30.5527L1.10346 23.381V9.16787ZM16.5517 30.5527V16.3396L30.8965 9.16787V23.381L16.5517 30.5527Z" fill="#053F31" />
    </svg>

  );
}

function IconOrderDate() {
  return (
    <svg width="30" height="32" viewBox="0 0 30 32" fill="none" xmlns="http://www.w3.org/2000/svg">
      <path d="M26.25 2.28571H24C24 1.02552 22.9905 0 21.75 0C20.5095 0 19.5 1.02552 19.5 2.28571H10.5C10.5 1.02552 9.4905 0 8.25 0C7.0095 0 6 1.02552 6 2.28571H3.75C1.68225 2.28571 0 3.99467 0 6.09524V28.1905C0 30.291 1.68225 32 3.75 32H26.25C28.3178 32 30 30.291 30 28.1905V6.09524C30 3.99467 28.3178 2.28571 26.25 2.28571ZM21 2.28571C21 1.8659 21.336 1.52381 21.75 1.52381C22.164 1.52381 22.5 1.8659 22.5 2.28571V3.80952C22.5 4.22933 22.164 4.57143 21.75 4.57143C21.336 4.57143 21 4.22933 21 3.80952V2.28571ZM7.5 2.28571C7.5 1.8659 7.836 1.52381 8.25 1.52381C8.664 1.52381 9 1.8659 9 2.28571V3.80952C9 4.22933 8.664 4.57143 8.25 4.57143C7.836 4.57143 7.5 4.22933 7.5 3.80952V2.28571ZM1.5 6.09524C1.5 4.83505 2.5095 3.80952 3.75 3.80952H6C6 5.06971 7.0095 6.09524 8.25 6.09524C9.4905 6.09524 10.5 5.06971 10.5 3.80952H19.5C19.5 5.06971 20.5095 6.09524 21.75 6.09524C22.9905 6.09524 24 5.06971 24 3.80952H26.25C27.4905 3.80952 28.5 4.83505 28.5 6.09524V9.14286H1.5V6.09524ZM28.5 28.1905C28.5 29.4507 27.4905 30.4762 26.25 30.4762H3.75C2.5095 30.4762 1.5 29.4507 1.5 28.1905V10.6667H28.5V28.1905Z" fill="#053F31" />
      <path d="M6 19.0476H8.25C9.07725 19.0476 9.75 18.3642 9.75 17.5238V15.2381C9.75 14.3977 9.07725 13.7143 8.25 13.7143H6C5.17275 13.7143 4.5 14.3977 4.5 15.2381V17.5238C4.5 18.3642 5.17275 19.0476 6 19.0476ZM6 15.2381H8.25L8.2515 17.5238H6V15.2381Z" fill="#053F31" />
      <path d="M13.875 19.0476H16.125C16.9523 19.0476 17.625 18.3642 17.625 17.5238V15.2381C17.625 14.3977 16.9523 13.7143 16.125 13.7143H13.875C13.0478 13.7143 12.375 14.3977 12.375 15.2381V17.5238C12.375 18.3642 13.0478 19.0476 13.875 19.0476ZM13.875 15.2381H16.125L16.1265 17.5238H13.875V15.2381Z" fill="#053F31" />
      <path d="M21.75 19.0476H24C24.8273 19.0476 25.5 18.3642 25.5 17.5238V15.2381C25.5 14.3977 24.8273 13.7143 24 13.7143H21.75C20.9228 13.7143 20.25 14.3977 20.25 15.2381V17.5238C20.25 18.3642 20.9228 19.0476 21.75 19.0476ZM21.75 15.2381H24L24.0015 17.5238H21.75V15.2381Z" fill="#053F31" />
      <path d="M6 27.4286H8.25C9.07725 27.4286 9.75 26.7451 9.75 25.9048V23.6191C9.75 22.7787 9.07725 22.0952 8.25 22.0952H6C5.17275 22.0952 4.5 22.7787 4.5 23.6191V25.9048C4.5 26.7451 5.17275 27.4286 6 27.4286ZM6 23.6191H8.25L8.2515 25.9048H6V23.6191Z" fill="#053F31" />
      <path d="M13.875 27.4286H16.125C16.9523 27.4286 17.625 26.7451 17.625 25.9048V23.6191C17.625 22.7787 16.9523 22.0952 16.125 22.0952H13.875C13.0478 22.0952 12.375 22.7787 12.375 23.6191V25.9048C12.375 26.7451 13.0478 27.4286 13.875 27.4286ZM13.875 23.6191H16.125L16.1265 25.9048H13.875V23.6191Z" fill="#053F31" />
      <path d="M21.75 27.4286H24C24.8273 27.4286 25.5 26.7451 25.5 25.9048V23.6191C25.5 22.7787 24.8273 22.0952 24 22.0952H21.75C20.9228 22.0952 20.25 22.7787 20.25 23.6191V25.9048C20.25 26.7451 20.9228 27.4286 21.75 27.4286ZM21.75 23.6191H24L24.0015 25.9048H21.75V23.6191Z" fill="#053F31" />
    </svg>

  );
}

function IconPayment() {
  return (
    <svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
      <path d="M28.6364 15.1258V10.9094C28.6364 9.47963 27.5274 8.31687 26.1262 8.20412L22.2104 1.36474C21.8475 0.732193 21.2616 0.280091 20.5604 0.0923594C19.8626 -0.0940936 19.1329 0.00383102 18.5083 0.367341L5.08487 8.18213H2.72729C1.22318 8.18213 0 9.40523 0 10.9094V27.2728C0 28.7768 1.22312 30 2.72729 30H25.9091C27.4132 30 28.6364 28.7769 28.6364 27.2728V23.0563C29.4283 22.7739 30 22.0242 30 21.1365V17.0456C30 16.1579 29.4283 15.4082 28.6364 15.1258ZM24.5416 8.18213H18.5989L23.056 5.58726L24.5416 8.18213ZM22.3785 4.40392L15.8887 8.18213H13.1969L21.7054 3.22837L22.3785 4.40392ZM19.1948 1.54582C19.5031 1.36538 19.8633 1.31744 20.2075 1.40936C20.5558 1.50255 20.8461 1.72761 21.0265 2.04254L21.0279 2.04503L10.4868 8.18213H7.79509L19.1948 1.54582ZM27.2727 27.2728C27.2727 28.0244 26.6608 28.6363 25.9091 28.6363H2.72729C1.97559 28.6363 1.36368 28.0244 1.36368 27.2728V10.9094C1.36368 10.1577 1.97559 9.54579 2.72729 9.54579H25.9091C26.6608 9.54579 27.2727 10.1577 27.2727 10.9094V15.0002H23.1818C20.9259 15.0002 19.0909 16.8352 19.0909 19.0911C19.0909 21.3469 20.9259 23.1819 23.1818 23.1819H27.2727V27.2728ZM28.6364 21.1365C28.6364 21.5127 28.3308 21.8183 27.9545 21.8183H23.1818C21.6777 21.8183 20.4545 20.5952 20.4545 19.0911C20.4545 17.587 21.6776 16.3638 23.1818 16.3638H27.9545C28.3307 16.3638 28.6364 16.6694 28.6364 17.0456V21.1365Z" fill="#053F31" />
      <path d="M23.1818 17.7275C22.4301 17.7275 21.8182 18.3394 21.8182 19.0911C21.8182 19.8428 22.4301 20.4547 23.1818 20.4547C23.9335 20.4547 24.5454 19.8428 24.5454 19.0911C24.5455 18.3394 23.9336 17.7275 23.1818 17.7275Z" fill="#053F31" />
    </svg>

  );
}

function IconTransaction() {
  return (
    <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
      <path d="M27.9128 7.7745L20.413 0.274687C20.2371 0.0989303 19.9987 0.000140526 19.75 0L6.625 0C5.07419 0 3.8125 1.26169 3.8125 2.8125V29.1875C3.8125 30.7383 5.07419 32 6.625 32H25.375C26.9258 32 28.1875 30.7383 28.1875 29.1875V8.4375C28.1875 8.18188 28.0802 7.94181 27.9128 7.7745ZM20.6875 3.20081L24.9867 7.5H21.625C21.1081 7.5 20.6875 7.07944 20.6875 6.5625V3.20081ZM25.375 30.125H6.625C6.10806 30.125 5.6875 29.7044 5.6875 29.1875V2.8125C5.6875 2.29556 6.10806 1.875 6.625 1.875H18.8125V6.5625C18.8125 8.11331 20.0742 9.375 21.625 9.375H26.3125V29.1875C26.3125 29.7044 25.8919 30.125 25.375 30.125Z" fill="#053F31" />
      <path d="M21.625 13.25H10.375C9.85725 13.25 9.4375 13.6697 9.4375 14.1875C9.4375 14.7053 9.85725 15.125 10.375 15.125H21.625C22.1427 15.125 22.5625 14.7053 22.5625 14.1875C22.5625 13.6697 22.1427 13.25 21.625 13.25ZM21.625 17H10.375C9.85725 17 9.4375 17.4198 9.4375 17.9375C9.4375 18.4552 9.85725 18.875 10.375 18.875H21.625C22.1427 18.875 22.5625 18.4552 22.5625 17.9375C22.5625 17.4198 22.1427 17 21.625 17ZM21.625 20.75H10.375C9.85725 20.75 9.4375 21.1698 9.4375 21.6875C9.4375 22.2052 9.85725 22.625 10.375 22.625H21.625C22.1427 22.625 22.5625 22.2052 22.5625 21.6875C22.5625 21.1698 22.1427 20.75 21.625 20.75ZM17.875 24.5H10.375C9.85725 24.5 9.4375 24.9198 9.4375 25.4375C9.4375 25.9552 9.85725 26.375 10.375 26.375H17.875C18.3927 26.375 18.8125 25.9552 18.8125 25.4375C18.8125 24.9198 18.3927 24.5 17.875 24.5Z" fill="#053F31" />
    </svg>

  );
}


type InfoTileProps = {
  icon: React.ReactNode;
  label: string;
  value: string;
};

const InfoTile = ({ icon, label, value }: InfoTileProps) => (
  <div className="flex items-center gap-4 ">
    <div className="shrink-0 p-[13px] rounded-[10px] border border-[#053F31]/20">{icon}</div>
    <div>
      <p className="font-outfit !text-[16px] font-light text-[#757575] mb-[3px]">{label}</p>
      <p className="font-outfit !text-[18px] font-normal ">{value}</p>
    </div>
  </div>
);

type OrderConfirmationProps = {
  orderNumber?: string;
  orderDate?: string;
  paymentMethod?: string;
  transactionId?: string;
};

export default function OrderConfirmation({
  orderNumber = "ORD-2025-0892",
  orderDate = "Saturday, February 14, 2026 - 14:32",
  paymentMethod = "Credit Card ending in •••• 4532",
  transactionId = "TXN-20260214325892",
}: OrderConfirmationProps) {
  return (
    <section className="bg-[#F7FAF8] rounded-[20px] border border-[#DAE6DC] px-6 py-7 md:p-[15px_30px] font-outfit shadow-xl">
      <h4 className="font-outfit font-medium text-[#053F31] mb-[10px] pb-[10px] border-b border-[#053F31]/20">
        Order Confirmation
      </h4>

      <div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
        <InfoTile
          icon={<IconOrderNumber />}
          label="Order Number"
          value={orderNumber}
        />
        <InfoTile
          icon={<IconOrderDate />}
          label="Order Date"
          value={orderDate}
        />
        <InfoTile
          icon={<IconPayment />}
          label="Payment Method"
          value={paymentMethod}
        />
        <InfoTile
          icon={<IconTransaction />}
          label="Transaction ID"
          value={transactionId}
        />
      </div>
    </section>
  );
}