mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
* 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
35 lines
741 B
TypeScript
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;
|