feat: add testimonials to the call page

This commit is contained in:
Oliver Davies 2023-06-02 10:08:35 +01:00
parent baeec8fab2
commit 295ee1980d
27 changed files with 207 additions and 148 deletions

View file

@ -0,0 +1,34 @@
---
import { getCollection, getEntries, getEntry } from 'astro:content';
import _ from "lodash";
interface Props {
names: string[];
}
const names = _(Astro.props.names);
const testimonials = await getCollection('testimonial', ({ id }) => names.includes(id));
const reversedTestimonials = _(testimonials).reverse()
---
{testimonials && (
<h2>What others have said</h2>
<div class="mt-6 space-y-14">
{reversedTestimonials.map(testimonial => (
<article>
<blockquote class="mt-4" set:html={testimonial.data.text} />
<footer class="flex items-center space-x-4 space-x-reverse">
<span class="text-base">{testimonial.data.name} - {testimonial.data.tagline}</span>
{testimonial.data.image && (
<span class="order-first not-prose">
<img width="50" height="50" class="w-15 h-15 rounded-full border" src={`/images/recommendations/${testimonial.data.image}`} />
</span>
)}
</footer>
</article>
))}
</div>
)}