Skip to content

Commit

Permalink
refresh DB update
Browse files Browse the repository at this point in the history
  • Loading branch information
punyakrit committed Mar 27, 2024
1 parent c20e36f commit 276a3b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Courses.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { RefreshDb } from './RefreshDb';

export const Courses = ({ courses }: { courses: Course[] }) => {
const router = useRouter();
const shouldShowRefreshDb = !courses || courses.length === 0;

return (
<section className="flex flex-col items-center w-full">
<div className="max-w-screen-xl w-full mx-auto py-6 px-6 cursor-pointer grid grid-cols-1 gap-5 md:grid-cols-3">
Expand All @@ -27,7 +29,7 @@ export const Courses = ({ courses }: { courses: Course[] }) => {
/>
))}
</div>
<RefreshDb />
{shouldShowRefreshDb && <RefreshDb />}
</section>
);
};

0 comments on commit 276a3b8

Please sign in to comment.