Don't prefetch links/pixels. Closes #3814

This commit is contained in:
Mike Cao 2025-12-03 00:03:56 -08:00
parent 1390e09400
commit 16cae691f6
5 changed files with 50 additions and 9 deletions

View file

@ -21,7 +21,11 @@ export function LinksTable(props: DataTableProps) {
<DataColumn id="slug" label={formatMessage(labels.link)}>
{({ slug }: any) => {
const url = getSlugUrl(slug);
return <ExternalLink href={url}>{url}</ExternalLink>;
return (
<ExternalLink href={url} prefetch={false}>
{url}
</ExternalLink>
);
}}
</DataColumn>
<DataColumn id="url" label={formatMessage(labels.destinationUrl)}>

View file

@ -21,7 +21,11 @@ export function PixelsTable(props: DataTableProps) {
<DataColumn id="url" label="URL">
{({ slug }: any) => {
const url = getSlugUrl(slug);
return <ExternalLink href={url}>{url}</ExternalLink>;
return (
<ExternalLink href={url} prefetch={false}>
{url}
</ExternalLink>
);
}}
</DataColumn>
<DataColumn id="created" label={formatMessage(labels.created)}>

View file

@ -1,8 +1,13 @@
import { Icon, Row, Text } from '@umami/react-zen';
import Link from 'next/link';
import Link, { type LinkProps } from 'next/link';
import type { ReactNode } from 'react';
import { ExternalLink as LinkIcon } from '@/components/icons';
export function ExternalLink({ href, children, ...props }) {
export function ExternalLink({
href,
children,
...props
}: LinkProps & { href: string; children: ReactNode }) {
return (
<Row alignItems="center" overflow="hidden" gap>
<Text title={href} truncate>