diff --git a/apps/site/components/Common/Button.tsx b/apps/site/components/Common/Button.tsx index 11768132a2d07..74b89251ad706 100644 --- a/apps/site/components/Common/Button.tsx +++ b/apps/site/components/Common/Button.tsx @@ -1,11 +1,9 @@ import BaseButton from '@node-core/ui-components/Common/BaseButton'; import type { ButtonProps } from '@node-core/ui-components/Common/BaseButton'; -import type { FC, ComponentProps } from 'react'; +import type { FC } from 'react'; import Link from '#site/components/Link'; -const Button: FC< - Omit & Omit, 'as' | 'size'> -> = props => ; +const Button: FC = props => ; export default Button; diff --git a/apps/site/components/Link.tsx b/apps/site/components/Link.tsx index b7d32ff911acd..63fcecdcb6087 100644 --- a/apps/site/components/Link.tsx +++ b/apps/site/components/Link.tsx @@ -1,25 +1,17 @@ -import type { FC, HTMLProps } from 'react'; +import type { FC, AnchorHTMLAttributes, ComponentProps } from 'react'; import { Link as LocalizedLink } from '#site/navigation.mjs'; -const Link: FC> = ({ - children, - href, - ...props -}) => { - if (!href || /^https?:/.test(href.toString())) { - return ( - - {children} - - ); +export type LinkProps = + | ComponentProps + | AnchorHTMLAttributes; + +const Link: FC = ({ href, ...props }) => { + if (!href || /^https?:/.test(href as string)) { + return ; } - return ( - - {children} - - ); + return ; }; export default Link; diff --git a/apps/site/components/LinkWithArrow.tsx b/apps/site/components/LinkWithArrow.tsx index 12eb3cdf5472d..8e9cc3abb91bd 100644 --- a/apps/site/components/LinkWithArrow.tsx +++ b/apps/site/components/LinkWithArrow.tsx @@ -1,12 +1,13 @@ import { ArrowUpRightIcon } from '@heroicons/react/24/solid'; import type { SlotProps } from '@radix-ui/react-slot'; import { Slot } from '@radix-ui/react-slot'; -import type { ComponentProps, FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; import Link from '#site/components/Link'; +import type { LinkProps } from '#site/components/Link'; type LinkWithArrowProps = - | ({ asChild?: false } & ComponentProps) + | ({ asChild?: false } & LinkProps) | ({ asChild: true } & SlotProps); const LinkWithArrow: FC> = ({ @@ -17,7 +18,7 @@ const LinkWithArrow: FC> = ({ const Comp = asChild ? Slot : Link; return ( - + {children} diff --git a/apps/site/components/Releases/MinorReleasesTable/index.tsx b/apps/site/components/Releases/MinorReleasesTable/index.tsx index 8cfbafcf91000..8aaa68f42562f 100644 --- a/apps/site/components/Releases/MinorReleasesTable/index.tsx +++ b/apps/site/components/Releases/MinorReleasesTable/index.tsx @@ -36,23 +36,16 @@ export const MinorReleasesTable: FC = ({
{t('components.minorReleasesTable.actions.release')} - + {t('components.minorReleasesTable.actions.changelog')} - + {t('components.minorReleasesTable.actions.docs')}