diff --git a/pages/about.js b/pages/about.js index c6f54e6..a2f675f 100644 --- a/pages/about.js +++ b/pages/about.js @@ -61,9 +61,24 @@ const About = () => { } function getProfileImage(r) { - const url = r.profile_photo_url || r.author_profile_photo_url || r.user?.thumbnail; + // Check multiple possible field names for profile images + const url = r.profile_photo_url || + r.author_profile_photo_url || + r.user?.thumbnail || + r.user?.profile_photo_url || + r.thumbnail || + r.profile_picture || + r.avatar; + if (!url) return null; - return url.startsWith("http") ? url : `https://lh3.googleusercontent.com/${url}`; + + // If it's already a full URL, return it + if (url.startsWith("http")) { + return url; + } + + // Otherwise, construct the Googleusercontent URL + return `https://lh3.googleusercontent.com/${url}`; } function getInitials(name) { diff --git a/pages/api/reviews.js b/pages/api/reviews.js index eddecef..6b97d9c 100644 --- a/pages/api/reviews.js +++ b/pages/api/reviews.js @@ -1,5 +1,5 @@ export default async function handler(req, res) { - const apiKey = "37eb7f83988cfd76ffb5c5af9adc25652efe5607e39997fc7d0e054d690ef25e"; + const apiKey = "8f20ae2ffd1700f38274ea87d2230ea8e0982834f8376bf311e7a4f5092662a8"; const placeId = "ChIJW9-CDf_X1IkRnBCKKZdqyvA"; // console.log("Pages API: Starting fetch for placeId:", placeId); diff --git a/src/components/Home/TestimonialSection.js b/src/components/Home/TestimonialSection.js index e398616..9e885d6 100644 --- a/src/components/Home/TestimonialSection.js +++ b/src/components/Home/TestimonialSection.js @@ -96,12 +96,10 @@ const TestimonialSection = () => { console.log("Home: Fetching reviews..."); const res = await fetch("/api/reviews"); const data = await res.json(); - console.log("Home: Received data:", data); const cleaned = (data.reviews || []).filter(r => (r.text || r.description || r.snippet || r.review_text || r.body || r.content) && r.rating >= 4 ); - console.log("Home: Cleaned reviews (rating >= 4):", cleaned.length); setReviews(cleaned); } catch (error) { console.error("Home: Failed to fetch reviews", error); @@ -131,9 +129,24 @@ const TestimonialSection = () => { } function getProfileImage(r) { - const url = r.profile_photo_url || r.author_profile_photo_url || r.user?.thumbnail; + // Check multiple possible field names for profile images + const url = r.profile_photo_url || + r.author_profile_photo_url || + r.user?.thumbnail || + r.user?.profile_photo_url || + r.thumbnail || + r.profile_picture || + r.avatar; + if (!url) return null; - return url.startsWith("http") ? url : `https://lh3.googleusercontent.com/${url}`; + + // If it's already a full URL, return it + if (url.startsWith("http")) { + return url; + } + + // Otherwise, construct the Googleusercontent URL + return `https://lh3.googleusercontent.com/${url}`; } function getInitials(name) {