a tool for shared writing and social publishing
1"use client";
2import Link from "next/link";
3import { useState } from "react";
4
5export function SpeedyLink(props: {
6 href: string;
7 className?: string;
8 style?: React.CSSProperties;
9 children?: React.ReactNode;
10}) {
11 let [prefetch, setPrefetch] = useState(false);
12 return (
13 <Link
14 onMouseEnter={() => setPrefetch(true)}
15 onPointerDown={() => setPrefetch(true)}
16 style={props.style}
17 prefetch={prefetch}
18 href={props.href}
19 className={props.className}
20 >
21 {props.children}
22 </Link>
23 );
24}