import { useHref } from 'react-router';
interface Props {
  name: string;
  uid?: string;
}
export default function User(props: Props) {
  const href = useHref(`/profile/${props.uid}`);
  if (!Number(props.uid)) return <span>{props.name}</span>
  return (
    <a href={href} target='_blank' rel='noopener noreferrer'>{props.name}</a>
  );
}