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() if (!patrons || patrons.length === 0) return ( ); if (displayStyle === 'box') { return (
{patrons.map((patron) => (
{patron.username && ( {patron.username} )} {patron.vanityLink && ( {patron.vanityLink} )}
))}
); } else if (displayStyle === 'list') { const patronNames = patrons.map((patron) => patron.username.trim()).join(', '); return {patronNames}; } else { return ; // Handle unsupported display styles or provide a default display style } }