import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import 'react-loading-skeleton/dist/skeleton.css'; import { getPatrons } from '../lib/patreon'; import Link from 'next/link' interface PatronsListProps { displayStyle: string; } export default async function PatronsList({ displayStyle }: PatronsListProps) { const patrons = await getPatrons() console.log('patrons list as follows') console.log(patrons) if (!patrons || patrons.length === 0) return ( ); if (displayStyle === 'box') { return (
{patrons.map((patron) => (
{patron.full_name && ( {patron.full_name} )}
))}
); } else if (displayStyle === 'list') { const patronNames = patrons.map((patron) => patron.full_name.trim()).join(', '); return {patronNames}; } else { return ; // Handle unsupported display styles or provide a default display style } }