--- import Headline from '~/components/ui/Headline.astro'; import WidgetWrapper from '~/components/ui/WidgetWrapper.astro'; import Button from '~/components/ui/Button.astro'; import ImageModal from '~/components/ui/ImageModal.astro'; import type { Testimonials as Props } from '~/types'; import DefaultImage from '~/assets/images/default.png'; // Function to get the correct image path for a testimonial const getImagePath = (image: unknown) => { if (typeof image === 'object' && image !== null && 'src' in image && typeof (image as { src: unknown }).src === 'string') { // If the image has a src property, use it return String((image as { src: string }).src); } // Otherwise, return the default image path return DefaultImage.src; }; // Function to get the alt text for an image const getImageAlt = (image: unknown, fallback: string = "Certification badge") => { if (typeof image === 'object' && image !== null && 'alt' in image && typeof (image as { alt: unknown }).alt === 'string') { return String((image as { alt: string }).alt); } return fallback; }; const { title = '', subtitle = '', tagline = '', testimonials = [], callToAction, id, isDark = false, classes = {}, bg = await Astro.slots.render('bg'), } = Astro.props; ---
{ testimonials && testimonials.map(({ linkUrl, name, issueDate, description, image }) => ( )) }
{/* Include the image modal component */} { callToAction && (
) }