export const fallbackGoogleReviews = [
  {
    author_name: "Ayesha K.",
    text: "The best Dosa I've had in Waterloo! Reminds me of home. The flavors are absolutely authentic and the service is wonderful.",
    rating: 5,
    author_title: "Local Guide",
  },
  {
    author_name: "Marcus T.",
    text: "A true culinary journey. The spices are perfectly balanced, the ambiance is stunning, and every dish tells a beautiful story. The attention to detail in every aspect of the meal is astounding. Highly recommended for anyone looking to explore the rich tapestry of Indian cuisine in a warm and welcoming environment.",
    rating: 5,
    author_title: "Food Critic",
  },
  {
    author_name: "Priya R.",
    text: "My go-to place for authentic South Indian comfort food. Their filter coffee and masala dosa are unmatched in the city.",
    rating: 5,
    author_title: "Regular Customer",
  },
];

export function formatReviewsForHome(reviews: any[]) {
  if (!Array.isArray(reviews)) return [];
  return reviews.map((r) => {
    let text = r.snippet || r.text || '';
    return {
      name: r.author_name || 'Guest',
      text: text,
      rating: r.rating || 5,
      role: r.author_title || 'Reviewer',
      initials: (r.author_name || 'G').charAt(0).toUpperCase()
    };
  });
}
