import { UISrefActive } from '@uirouter/react'; import { Children, ComponentProps, ReactNode } from 'react'; import _ from 'lodash'; import { Link as NavLink } from '@@/Link'; import styles from './Link.module.css'; interface Props extends ComponentProps { children: ReactNode; } export function Link({ children, to, options, params, title }: Props) { const label = title || getLabel(children); return ( {children} ); } function getLabel(children: ReactNode) { return _.first( _.compact( Children.map(children, (child) => { if (typeof child === 'string') { return child; } return ''; }) ) ); }