Reputation — @sonordev/site-kit/reputation
Display client reviews, testimonials, and rating statistics from Sonor.
Usage
import { TestimonialSection } from '@sonordev/site-kit/reputation'
export default function ReviewsPage() {
return (
<TestimonialSection
title="What Our Clients Say"
showRating
maxReviews={6}
/>
)
}TestimonialSection Props
interface TestimonialSectionProps {
title?: string
subtitle?: string
autoplay?: boolean // Auto-rotate reviews
autoplayInterval?: number // ms between rotations
showRating?: boolean // Display star ratings
showPhoto?: boolean // Show attached business photo (default true)
maxReviews?: number // Limit displayed count
featuredOnly?: boolean // Show featured reviews only
service?: string // Filter by service tag
className?: string
}Visual review cards
Render a photo and its original review together with a responsive, server-rendered gallery:
import { fetchReviews, VisualReviewGallery } from '@sonordev/site-kit/reputation/server'
export default async function ReviewsPage() {
const reviews = await fetchReviews({ limit: 12 })
return <VisualReviewGallery reviews={reviews} title="What Our Clients Say" />
}VisualReviewCard accepts one review, optional showRating and className.
VisualReviewGallery accepts reviews, optional title, subtitle, showRating
and className. Both use the site's --sk-* brand tokens and work in React
Server Components. Import @sonordev/site-kit/brand.css once for token defaults,
then override them in your site's CSS.
Text-only reviews stay visible while a photo is pending. Adding or removing a
photo in Sonor updates the public review feed; image continues to mean the
reviewer's avatar. Only HTTPS photo URLs are displayed.
API Functions
import { fetchReviews, fetchReviewStats } from '@sonordev/site-kit/reputation'
const reviews = await fetchReviews({ service: 'divorce', limit: 10, featured: true })
const stats = await fetchReviewStats() // { total_reviews, average_rating, distribution }Types
interface Review {
id: string; quote: string; name: string; role?: string;
rating: number; image?: string; date?: string;
platform?: string; isFeatured?: boolean; serviceTags?: string[];
photo?: { fileId: string; url: string; altText: string; caption: string } | null;
}
interface ReviewStats {
total_reviews: number
average_rating: number
distribution: { 1: number; 2: number; 3: number; 4: number; 5: number }
}Caching
Uses in-memory cache (60s TTL) with retry-on-429 backoff to prevent rate limiting during dev hot reload.