nextui/apps/docs/content/components/link/custom-impl.raw.tsx
WK 0d217e466f
refactor: optimization (#5362)
* chore(deps): bump RA versions

* chore(deps): bump RA versions

* chore(deps): bump RA versions

* chore: changeset

* chore(deps): remove unnecessary dependencies

* fix(calendar): typing issue

* refactor(system): remove unused SupportedCalendars

* refactor(system): move I18nProviderProps to type

* refactor: use `spectrumCalendarProps<DateValue>["createCalendar"]`

* feat: add consistent-type-imports

* fix: eslint

* chore: add changeset

* refactor: remove unused deps
2025-06-09 14:17:44 +08:00

35 lines
741 B
TypeScript

import type {LinkProps} from "@heroui/react";
import React, {forwardRef} from "react";
import {LinkIcon} from "@heroui/shared-icons";
import {linkAnchorClasses} from "@heroui/theme";
import {useLink} from "@heroui/react";
export interface MyLinkProps extends LinkProps {}
const MyLink = forwardRef<HTMLAnchorElement, MyLinkProps>((props, ref) => {
const {
Component,
children,
showAnchorIcon,
anchorIcon = <LinkIcon className={linkAnchorClasses} />,
getLinkProps,
} = useLink({
...props,
ref,
});
return (
<Component {...getLinkProps()}>
<>
{children}
{showAnchorIcon && anchorIcon}
</>
</Component>
);
});
MyLink.displayName = "MyLink";
export default MyLink;