Skip to content

Commit

Permalink
if there's no media, display a message
Browse files Browse the repository at this point in the history
  • Loading branch information
gregrickaby committed Feb 13, 2024
1 parent 61f3b13 commit cd206bc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/r/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ export default async function Page(props: PageProps) {
)
}

// No media? Bail.
if (!posts.data.children.length) {
return (
<div className="text-center">
<h2>No media found</h2>
<p>Try a different subreddit.</p>
</div>
)
}

return (
<div className="posts relative text-center">
<h2 className="mt-0">
Expand Down

0 comments on commit cd206bc

Please sign in to comment.