We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c19dc52 commit 68f0ffaCopy full SHA for 68f0ffa
components/containers/Card.js
@@ -11,6 +11,13 @@ export default function Card({
11
linkText,
12
customClass,
13
}) {
14
+ const LinkComponent = link?.startsWith('http') ? (
15
+ <a href={link} target='_blank' rel='noopener noreferrer'>
16
+ {linkText}
17
+ </a>
18
+ ) : (
19
+ <Link href={link}>{linkText}</Link>
20
+ );
21
return (
22
<div
23
className={
@@ -32,7 +39,7 @@ export default function Card({
32
39
<h2 className={styles.title}>{title}</h2>
33
40
<div className={styles.content}>
34
41
<p>
35
- {content} {link && <Link href={link}>{linkText}</Link>}
42
+ {content} {link && LinkComponent}
36
43
</p>
37
44
</div>
38
45
0 commit comments