import { useApp } from "@/pages/app/AppContext";
import { BackHeader, Badge } from "@/pages/app/components/ui";
import { BizOpportunityReadonly } from "@/pages/app/components/biz/BizUI";
import { bizOpportunities } from "@/mocks/dshnBizOwner";

export default function BizOpportunityExpired() {
  const { goBack } = useApp();
  const op = bizOpportunities.find((o) => o.status === "ended") ?? bizOpportunities[0];

  return (
    <div className="min-h-full flex flex-col bg-background-50">
      <BackHeader title="الفرصة الاستثمارية" onBack={goBack} action={<Badge tone="neutral">منتهية</Badge>} />

      <div className="flex-1 px-4 py-5 space-y-4">
        <div className="rounded-[16px] bg-background-100 border border-background-200 p-4 flex items-start gap-2.5">
          <i className="ri-time-line text-[18px] text-foreground-600 leading-none mt-0.5" />
          <p className="text-[12px] text-foreground-700 leading-relaxed">
            انتهت مدة هذه الفرصة دون اكتمال الاستثمار. تمت إزالتها من القائمة العامة ونقلها إلى الفرص السابقة.
          </p>
        </div>

        <div className="rounded-[16px] bg-background-100 border border-background-200 px-4 py-3 flex items-center justify-between">
          <span className="text-[11.5px] text-foreground-600">تاريخ الانتهاء</span>
          <span className="text-[12.5px] font-semibold text-foreground-950">{op.endDate ?? "—"}</span>
        </div>

        <BizOpportunityReadonly op={op} />
      </div>
    </div>
  );
}