import { getGoals } from "@/lib/pm"; import { getCampaign } from "@/lib/patreon"; interface IFundingStatusBadgeProps { completedPercentage: number; } function FundingStatusBadge({ completedPercentage }: IFundingStatusBadgeProps) { if (completedPercentage === 100) return Funded; return ( {completedPercentage}% Funded ); } // export interface IGoals { // complete: IIssue[]; // inProgress: IIssue[]; // planned: IIssue[]; // featuredFunded: IIssue; // featuredUnfunded: IIssue; // } export default async function Page() { const { pledgeSum } = await getCampaign() const goals = await getGoals(pledgeSum); if (!goals) return

failed to get goals

const { inProgress, planned, complete } = goals; return ( <>

Goals

In Progress

    {inProgress.map((goal) => (
  • ☐ {goal.title} {(!!goal?.amountCents && !!goal.completedPercentage) && }
  • ))}

Planned

    {planned.map((goal) => (
  • ☐ {goal.title} {(!!goal?.amountCents && !!goal.completedPercentage) && }
  • ))}

Completed

    {complete.map((goal) => (
  • ✅ {goal.title} {(!!goal?.amountCents && !!goal.completedPercentage) && }
  • ))}
) }