diff --git a/app/credits/page.tsx b/app/credits/page.tsx index 80fca88..571bf3e 100644 --- a/app/credits/page.tsx +++ b/app/credits/page.tsx @@ -54,7 +54,8 @@ export default async function Page(props: Props) { - You currently have {credits} credits. + You currently have{' '} + {credits.ai_credit} credits. diff --git a/components/episode-ai-summary/episode-ai-summary.tsx b/components/episode-ai-summary/episode-ai-summary.tsx index e8c7136..0437f60 100644 --- a/components/episode-ai-summary/episode-ai-summary.tsx +++ b/components/episode-ai-summary/episode-ai-summary.tsx @@ -3,7 +3,7 @@ import type { Tables } from '@/types/supabase/database'; import { DatabaseError } from '@/lib/errors'; import { fetchAccountAICredits } from '@/lib/services/account'; import { createSupabaseServerClient } from '@/lib/services/supabase/server'; -import { Button, Flex } from '@radix-ui/themes'; +import { Button, CalloutRoot, CalloutText, Flex } from '@radix-ui/themes'; import { cookies } from 'next/headers'; import Link from 'next/link'; import { CgDollar } from 'react-icons/cg'; @@ -30,7 +30,20 @@ export async function EpisodeAISummary(props: Props) { } if (data.length === 0 || data[0].text_summary === null) { - if (credits < 1) { + if (credits.ai_credit_remaining_usage < 1) { + return ( + + + + You have used all your spendable credits. Thanks for using + beecast! + + + + ); + } + + if (credits.ai_credit < 1) { return (