2026-01-27 13:54:22 +05:30
|
|
|
/**
|
|
|
|
|
* Copyright (c) 2023-present Plane Software, Inc. and contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
* See the LICENSE file for details.
|
|
|
|
|
*/
|
|
|
|
|
|
2025-11-06 00:09:35 -08:00
|
|
|
import React from "react";
|
|
|
|
|
import { Link as RRLink } from "react-router";
|
|
|
|
|
import { ensureTrailingSlash } from "./helper";
|
|
|
|
|
|
|
|
|
|
type NextLinkProps = React.ComponentProps<"a"> & {
|
|
|
|
|
href: string;
|
|
|
|
|
replace?: boolean;
|
|
|
|
|
prefetch?: boolean; // next.js prop, ignored
|
|
|
|
|
scroll?: boolean; // next.js prop, ignored
|
|
|
|
|
shallow?: boolean; // next.js prop, ignored
|
|
|
|
|
};
|
|
|
|
|
|
2025-11-20 19:09:40 +07:00
|
|
|
function Link({ href, replace, prefetch: _prefetch, scroll: _scroll, shallow: _shallow, ...rest }: NextLinkProps) {
|
|
|
|
|
return <RRLink to={ensureTrailingSlash(href)} replace={replace} {...rest} />;
|
|
|
|
|
}
|
2025-11-06 00:09:35 -08:00
|
|
|
|
|
|
|
|
export default Link;
|