xylabs/sdk-react

View on GitHub
packages/link/src/LinkEx.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import { Link } from '@mui/material'
import { forwardRef } from 'react'

import { LinkExProps } from './LinkExProps'
import { LinkToEx } from './LinkToEx'

export const LinkEx = forwardRef<HTMLAnchorElement, LinkExProps>(({ to, ...props }, ref) => {
  return to ? <LinkToEx ref={ref} to={to} {...props} /> : <Link ref={ref} {...props} />
})

LinkEx.displayName = 'LinkExXYLabs'