@i-novus/ui-core
Version:
Базовые UI компоненты
14 lines (13 loc) • 739 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { forwardRef } from 'react';
import classNames from 'classnames';
import { useConfigProvider } from '../../core';
import { TypographyBody } from './Typography';
export const Link = forwardRef((props, ref) => {
const { tag = 'a', className, prefix, to, target, ...restProps } = props;
const { getPrefix } = useConfigProvider();
const prefixCls = getPrefix(prefix);
return (_jsx(TypographyBody, { tag: tag, ref: ref,
// @ts-expect-error: Путает свойство href с ref
href: to, target: target, className: classNames(className, `${prefixCls}-typography-link`), ...target === '_blank' && { rel: 'noopener noreferrer' }, ...restProps }));
});