diff --git a/src/app/hack/[slug]/page.tsx b/src/app/hack/[slug]/page.tsx index 059ad53..ca8fddb 100644 --- a/src/app/hack/[slug]/page.tsx +++ b/src/app/hack/[slug]/page.tsx @@ -558,6 +558,7 @@ export default async function HackDetail({ params }: HackDetailProps) {
  • diff --git a/src/app/page.tsx b/src/app/page.tsx index 0704d17..16d1d0c 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -247,7 +247,7 @@ export default async function Home() {
    {hackData.map((hack) => ( - + ))}
    diff --git a/src/components/HackCard.tsx b/src/components/HackCard.tsx index 90ab8d3..94137e4 100644 --- a/src/components/HackCard.tsx +++ b/src/components/HackCard.tsx @@ -13,6 +13,7 @@ import { FaRegImages } from "react-icons/fa6"; import { ImDownload } from "react-icons/im"; import { RiArchiveStackFill } from "react-icons/ri"; import type { Database } from "@/types/db"; +import type { LinkProps } from "next/link"; export interface HackCardAttributes { slug: string; @@ -29,7 +30,19 @@ export interface HackCardAttributes { completion_status?: Database["public"]["Enums"]["Completion Status"] | null; }; -export default function HackCard({ hack, clickable = true, className = "" }: { hack: HackCardAttributes; clickable?: boolean; className?: string }) { +interface HackCardProps { + hack: HackCardAttributes; + clickable?: boolean; + prefetch?: LinkProps["prefetch"]; + className?: string; +} + +export default function HackCard({ + hack, + clickable = true, + prefetch = false, + className = "", +}: HackCardProps) { const isArchive = hack.is_archive; const { isLinked, hasPermission, hasCached } = useBaseRoms(); const match = baseRoms.find((r) => r.id === hack.baseRomId); @@ -222,6 +235,7 @@ export default function HackCard({ hack, clickable = true, className = "" }: { h href={`/hack/${hack.slug}`} className={`group block ${className}`.trim()} draggable={false} + prefetch={prefetch} onDragStart={(e) => { e.preventDefault(); }}