// src/utils/photo-helpers.ts
function getPhotoUrl(photos) {
  if (photos && photos.length > 0) {
    const featuredPhoto = photos.find((pa) => pa.featured);
    const photoToUse = featuredPhoto || photos[0];
    const photo = photoToUse.photo;
    if (photo) {
      return photo.large_url || photo.medium_url || photo.thumbnail_url || photo.original_url || null;
    }
  }
  return null;
}
function getAvatarUrl(photos, fallbackId, name) {
  const photoUrl = getPhotoUrl(photos);
  if (photoUrl) {
    return photoUrl;
  }
  if (name) {
    return `https://ui-avatars.com/api/?name=${encodeURIComponent(name)}&background=random`;
  }
  return `https://ui-avatars.com/api/?name=User&background=random`;
}
function getFeaturedImageUrl(photos) {
  return getPhotoUrl(photos);
}
function getLogoUrl(websitePhotos) {
  var _a;
  if ((_a = websitePhotos == null ? void 0 : websitePhotos.logo) == null ? void 0 : _a.url) {
    return websitePhotos.logo.url;
  }
  return void 0;
}
export {
  getAvatarUrl,
  getFeaturedImageUrl,
  getLogoUrl,
  getPhotoUrl
};
//# sourceMappingURL=photo-helpers.js.map