mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-15 09:11:57 +10:00
fix links in PDF
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
import clsx from 'clsx';
|
||||
import isEmpty from 'lodash/isEmpty';
|
||||
|
||||
import { addHttp } from '@/utils/template';
|
||||
|
||||
type Props = {
|
||||
icon?: JSX.Element;
|
||||
link?: string;
|
||||
@ -11,11 +13,16 @@ type Props = {
|
||||
const DataDisplay: React.FC<React.PropsWithChildren<Props>> = ({ icon, link, className, textClassName, children }) => {
|
||||
if (isEmpty(children)) return null;
|
||||
|
||||
if (!isEmpty(link)) {
|
||||
if (link && !isEmpty(link)) {
|
||||
return (
|
||||
<div className={clsx('inline-flex items-center gap-1', className)}>
|
||||
{icon}
|
||||
<a href={link} target="_blank" rel="noreferrer" className="{textClassName}">
|
||||
<a
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
href={addHttp(link)}
|
||||
className={clsx('underline underline-offset-2', textClassName)}
|
||||
>
|
||||
{children}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user