diff --git a/src/app/hack/[slug]/page.tsx b/src/app/hack/[slug]/page.tsx index 8eb5835..d01e4f4 100644 --- a/src/app/hack/[slug]/page.tsx +++ b/src/app/hack/[slug]/page.tsx @@ -7,6 +7,7 @@ import HackActions from "@/components/Hack/HackActions"; import Markdown from "@/components/Markdown/Markdown"; import Image from "next/image"; import { FaDiscord, FaTwitter, FaGithub, FaTriangleExclamation, FaArrowUpRightFromSquare } from "react-icons/fa6"; +import { FiAlertTriangle } from "react-icons/fi"; import PokeCommunityIcon from "@/components/Icons/PokeCommunityIcon"; import { createClient, createServiceClient } from "@/utils/supabase/server"; import HackOptionsMenu from "@/components/Hack/HackOptionsMenu"; @@ -152,6 +153,8 @@ export default async function HackDetail({ params }: HackDetailProps) { const lastUpdated = patch ? new Date(patch.created_at).toLocaleDateString() : null; const patchCreatedAt = patch?.created_at || null; const patchChangelog = patch?.changelog || null; + const hasMissingPatch = !hack.approved && patchId === null; + const hasMissingScreenshots = !hack.approved && images.length === 0; // Build canonical URL, sameAs, dates, and JSON-LD const hdrs = await headers(); @@ -215,7 +218,7 @@ export default async function HackDetail({ params }: HackDetailProps) { type="application/ld+json" dangerouslySetInnerHTML={{ __html: serialize(jsonLd, { isJSON: true }) }} /> - {!isInformationalArchive && ( + {!isInformationalArchive && !hasMissingPatch && ( -
-
- + <> + {hasMissingPatch && ( + isAdmin ? ( +
+
+
+ +
+
+

+ This hack is missing a patch file. +

+

+ A patch file must be uploaded before this hack can be approved. Please try to ask the creator to upload a patch file. +

+
+
-
-

- You are viewing this unpublished hack as an admin. -

-

- This hack is pending approval. Please review the contents of this hack before making a decision. Then choose Approve from the dropdown options. -

+ ) : ( +
+
+
+ +
+
+

+ Your hack is missing a patch file. +

+

+ You need to upload a patch file before an admin can approve your hack. Use the options menu to upload a patch file. +

+
+
-
-
- ) : ( -
-
-
- + ) + )} + {hasMissingScreenshots && ( + isAdmin ? ( +
+
+
+ +
+
+

+ This hack is missing screenshots. +

+

+ Screenshots should be uploaded before this hack can be approved. Please try to ask the creator to add screenshots. +

+
+
-
-

- This hack is pending approval. -

-

- Your hack is currently under review and will be visible to all users once approved by an admin. -

+ ) : ( +
+
+
+ +
+
+

+ Your hack is missing screenshots. +

+

+ You should add screenshots before an admin can approve your hack. Use the options menu to add screenshots. +

+
+
-
-
- ) + ) + )} + {!hasMissingPatch && !hasMissingScreenshots && ( + isAdmin ? ( +
+
+
+ +
+
+

+ You are viewing this unpublished hack as an admin. +

+

+ This hack is pending approval. Please review the contents of this hack before making a decision. Then choose Approve from the dropdown options. +

+
+
+
+ ) : ( +
+
+
+ +
+
+

+ Your hack is pending approval. +

+

+ Your hack is currently under review and will be visible to all users once approved by an admin. +

+
+
+
+ ) + )} + )}
@@ -289,9 +366,16 @@ export default async function HackDetail({ params }: HackDetailProps) {

{hack.title}

- - {patchVersion || "Pre-release"} - + {hasMissingPatch ? ( +
+ + Missing Patch +
+ ) : ( + + {patchVersion || "Pre-release"} + + )} {!isArchive && (