aboutsummaryrefslogtreecommitdiff
path: root/src/components/BlockQuote.js
diff options
context:
space:
mode:
author安竹洋平 <61961825+yasutakeyohei@users.noreply.github.com>2024-05-11 00:16:48 +0900
committer安竹洋平 <61961825+yasutakeyohei@users.noreply.github.com>2024-05-11 00:16:48 +0900
commit2c67177d572ca329be2074adc06fbf915f4fa884 (patch)
treef4e9df1a91afbe352ecc77f11a457b8a8fed71bd /src/components/BlockQuote.js
parent9a95f9e4f5e84436a4b129fa9ba1d832afdac176 (diff)
hrefが空の場合はリンクしないように
Diffstat (limited to 'src/components/BlockQuote.js')
-rw-r--r--src/components/BlockQuote.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/components/BlockQuote.js b/src/components/BlockQuote.js
index 18eac100..605ae03d 100644
--- a/src/components/BlockQuote.js
+++ b/src/components/BlockQuote.js
@@ -4,9 +4,17 @@ import styles from './BlockQuote.module.css';
import { Icon } from '@iconify/react'; // Import the entire Iconify library.
export default function BlockQuote({children, refs, href}) {
+ if (href) {
+ return (
+ <blockquote className={styles.qt}>
+ <header><cite><ExternalLink href={href}>{refs}</ExternalLink></cite></header>
+ {children}
+ </blockquote>
+ );
+ }
return (
<blockquote className={styles.qt}>
- <header><cite><ExternalLink href={href}>{refs}</ExternalLink></cite></header>
+ <header><cite>{refs}</cite></header>
{children}
</blockquote>
);