migrate 2

This commit is contained in:
tresabhi committed 2026-08-18 13:02:59 -05:00
1 parent 9839d4eef5
commit cfc0ebb8e5
18 files changed
+348 -266

No files matched your search

+9 -8
View File
@@ -1,14 +1,15 @@
import locales from "@blitzkit/i18n/locales.json";
import { Link, type LinkProps } from "@radix-ui/themes";
import type { LocaleAcceptorProps } from "../hooks/useLocale";
import { Link, type LinkProps } from "./Link";
type LinkI18nProps = LinkProps & LocaleAcceptorProps;
export function LinkI18n({ locale, href, ...props }: LinkI18nProps) {
const prefix =
locale === undefined || locale === locales.default ? "" : `/${locale}`;
export interface LinkI18n extends LinkProps {
locale: string;
}
export function LinkI18n({ locale, href, ...props }: LinkI18n) {
return (
<Link href={href?.startsWith("/") ? `${prefix}${href}` : href} {...props} />
<Link
href={`${locale === locales.default ? "" : `/${locale}`}${href}`}
{...props}
/>
);
}