import type { DealDraft } from "../../models/DealDraft"

type Props = {
  data: DealDraft
  onBack: () => void
  onSubmit: () => void
}

export default function DealReviewStep({
  data,
  onBack,
  onSubmit,
}: Props) {
  return (
    <div className="flex flex-col gap-4">
      <div className="text-sm bg-gray-100 p-3 rounded">
        <p><b>Link:</b> {data.url}</p>
        <p><b>Başlık:</b> {data.title}</p>
        <p><b>Fiyat:</b> {data.price ?? "-"}</p>
      </div>

      {data.imageUrl && (
        <img
          src={data.imageUrl}
          alt=""
          className="w-32 h-32 object-cover rounded"
        />
      )}

      <div className="flex gap-2">
        <button
          onClick={onBack}
          className="border px-4 py-2 rounded-md"
        >
          Geri
        </button>

        <button
          onClick={onSubmit}
          className="bg-primary text-white px-4 py-2 rounded-md"
        >
          Gönder
        </button>
      </div>
    </div>
  )
}
