import React from 'react'; import Link from 'next/link'; import Image from 'next/image'; import { supabase } from '@/utils/supabase'; import { generateMetadata as createMetadata } from '@/components/Metadata'; import type { Metadata } from 'next'; interface AuthorProfile { name: string; bio: string; x_link?: string; fb_link?: string; insta_link?: string; pfp_link?: string; } export async function generateMetadata(): Promise { return createMetadata({ title: 'Authors', description: 'Meet the authors of Confessions of Grace and learn about their backgrounds in Reformed theology.', url: 'https://confessionsofgrace.com/authors', type: 'website' }); } async function getAuthors(): Promise { try { const { data: authorsData, error } = await supabase .from('authors') .select('name, bio, x_link, fb_link, insta_link, pfp_link'); if (error || !authorsData) { console.error('Error fetching authors:', error); return []; } return authorsData; } catch (error) { console.error('Failed to fetch authors during build:', error); return []; } } export default async function AuthorsPage() { const authors = await getAuthors(); return (

Meet the Authors

{authors.map((author) => (
{`${author.name}'s

{author.name}

{/* You can include bio or social icons here */} ))}
View All Posts
); }