Files
blitzkit/packages/website/src/components/LinkI18n.tsx
T

15 lines
355 B
TypeScript
Raw Normal View History

2025-09-27 16:07:45 -05:00
import locales from "@blitzkit/i18n/locales.json";
2026-08-18 13:02:59 -05:00
import { Link, type LinkProps } from "./Link";
2024-12-27 13:43:25 -06:00
2026-08-18 13:02:59 -05:00
export interface LinkI18n extends LinkProps {
locale: string;
}
2024-12-27 13:43:25 -06:00
2026-08-18 13:02:59 -05:00
export function LinkI18n({ locale, href, ...props }: LinkI18n) {
2024-12-27 13:43:25 -06:00
return (
2026-08-18 13:02:59 -05:00
<Link
href={`${locale === locales.default ? "" : `/${locale}`}${href}`}
{...props}
/>
2024-12-27 13:43:25 -06:00
);
}