import type { Seller } from "../../models/seller/Seller"
import type { SellerFromLookupResponse } from "../../api/seller/types"

export function mapSellerFromLookupResponse(
  api: SellerFromLookupResponse
): Seller | null {
  if (!api.found || !api.seller) return null

  return {
    id: api.seller.id,
    name: api.seller.name,
    url: api.seller.url ?? null,
  }
}
