import React, { forwardRef } from 'react' import type { ComponentProps, ReactElement } from 'react' import * as cn from "./Anchor.styles"; export type AnchorProps = Omit, 'ref'> & { newWindow?: boolean as?: React.ElementType } export const Anchor = forwardRef(function ( { href = '', children, newWindow, as, ...props }, // ref is used in forwardedRef ): ReactElement { const Link = as || $Anchor if (newWindow) { return ( {children} ) } return ( {children} ) }) Anchor.displayName = 'Anchor' function $Anchor({ children, ...rest }) { return {children} }