59 lines
1.5 KiB
TypeScript
59 lines
1.5 KiB
TypeScript
export type Testimonial = {
|
||
id: string;
|
||
rating: number;
|
||
title: string;
|
||
content: string;
|
||
author: {
|
||
name: string;
|
||
location?: string;
|
||
company?: string;
|
||
role?: string;
|
||
};
|
||
date: string;
|
||
datePublished: string;
|
||
verified: boolean;
|
||
featured: boolean;
|
||
useCase?: string;
|
||
};
|
||
|
||
export type AggregateRating = {
|
||
ratingValue: number;
|
||
reviewCount: number;
|
||
bestRating: number;
|
||
worstRating: number;
|
||
};
|
||
|
||
export const testimonials: Testimonial[] = [
|
||
{
|
||
id: "pottery-claudia-knuth-001",
|
||
rating: 5,
|
||
title: "Perfect for my pottery",
|
||
content: "I use QR-Master for my pottery as a link to my homepage and as a digital business card. I place the codes directly on my pottery pieces so interested customers can instantly access my website. Reliable and practical – a great solution!",
|
||
author: {
|
||
name: "Claudia",
|
||
company: "Hotshpotsh",
|
||
location: "Texas"
|
||
},
|
||
date: "January 2026",
|
||
datePublished: "2026-01-15T00:00:00Z",
|
||
verified: true,
|
||
featured: true,
|
||
useCase: "pottery"
|
||
}
|
||
];
|
||
|
||
export function getAggregateRating(): AggregateRating {
|
||
const ratings = testimonials.map(t => t.rating);
|
||
const avgRating = ratings.reduce((a, b) => a + b, 0) / ratings.length;
|
||
return {
|
||
ratingValue: Number(avgRating.toFixed(1)),
|
||
reviewCount: testimonials.length,
|
||
bestRating: 5,
|
||
worstRating: 1
|
||
};
|
||
}
|
||
|
||
export function getFeaturedTestimonials(): Testimonial[] {
|
||
return testimonials.filter(t => t.featured);
|
||
}
|