diff --git a/src/components/Courses.tsx b/src/components/Courses.tsx index 2f348b448..4e550d4d9 100644 --- a/src/components/Courses.tsx +++ b/src/components/Courses.tsx @@ -3,7 +3,6 @@ import { Course } from '@prisma/client'; import { CourseCard } from './CourseCard'; import { useRouter } from 'next/navigation'; -import { RefreshDb } from './RefreshDb'; export const Courses = ({ courses }: { courses: Course[] }) => { const router = useRouter(); @@ -27,7 +26,6 @@ export const Courses = ({ courses }: { courses: Course[] }) => { /> ))} - ); }; diff --git a/src/components/MyCourses.tsx b/src/components/MyCourses.tsx index 794eb85db..51f3c05e4 100644 --- a/src/components/MyCourses.tsx +++ b/src/components/MyCourses.tsx @@ -3,6 +3,8 @@ import { authOptions } from '@/lib/auth'; import { getPurchases } from '@/utiles/appx'; import { getServerSession } from 'next-auth'; import { Logout } from './Logout'; +import { RefreshDb } from './RefreshDb'; +import { refreshDb } from '@/actions/refresh-db'; const getCourses = async () => { const session = await getServerSession(authOptions); const purchases = await getPurchases(session?.user.email || ''); @@ -22,5 +24,10 @@ export const MyCourses = async () => { ); - return ; + return ( + <> + + + + ); }; diff --git a/src/components/RefreshDb.tsx b/src/components/RefreshDb.tsx index 8303a6efa..f058bc14c 100644 --- a/src/components/RefreshDb.tsx +++ b/src/components/RefreshDb.tsx @@ -1,10 +1,10 @@ 'use client'; -import { refreshDb } from '@/actions/refresh-db'; import { Button } from './ui/button'; import { toast } from 'sonner'; import { useSession } from 'next-auth/react'; -export function RefreshDb() { +//@ts-ignore +export function RefreshDb({ refreshDb }) { const session = useSession(); console.log(session); @@ -21,7 +21,7 @@ export function RefreshDb() { if (session.status === 'loading') return <>Loading...; return ( -
+

Don't see all your courses?