11import React , { useEffect , useState } from 'react'
22import { useTranslation } from 'react-i18next'
33import extractInfo , { type ExtractedInfo } from '../../lib/extract-info.js'
4+ import { DocLink } from '../common/DocLink'
45
56export interface CidInfoProps extends React . HTMLAttributes < HTMLDivElement > {
67 cid : string | null
@@ -31,9 +32,9 @@ export const CidInfo: React.FC<CidInfoProps> = ({ cid, className, ...props }) =>
3132 return (
3233 < section className = { `ph3 pv4 sans-serif ${ className } ` } { ...props } >
3334 < label className = 'db pb2' >
34- < a className = 'tracked ttu f5 fw2 teal-muted hover-aqua link' href = 'https://docs.ipfs.io/concepts/glossary/#cid' rel = 'external' target = '_external '>
35+ < DocLink term = 'cid' className = 'tracked ttu f5 fw2' >
3536 { t ( 'CidInfo.header' ) }
36- </ a >
37+ </ DocLink >
3738 </ label >
3839 { ( cidInfo == null )
3940 ? null
@@ -48,12 +49,9 @@ export const CidInfo: React.FC<CidInfoProps> = ({ cid, className, ...props }) =>
4849 < label htmlFor = 'CidInfo-human-readable-cid' className = 'db fw2 ma0 mid-gray ttu f7 tracked' >
4950 { t ( 'base' ) } - { t ( 'version' ) } - { t ( 'codec' ) } - { t ( 'multihash' ) }
5051 </ label >
51- < a
52- href = 'https://docs.ipfs.io/concepts/glossary/#multihash' rel = 'external' target = '_external'
53- className = 'dib tracked ttu f6 fw2 teal-muted hover-aqua link mt4'
54- >
52+ < DocLink term = 'multihash' className = 'dib tracked ttu f6 fw2 mt4' >
5553 { t ( 'multihash' ) }
56- </ a >
54+ </ DocLink >
5755 < div >
5856 < div className = 'dib monospace f6 pt2 tr dark-gray lh-title ph2' >
5957 < code className = 'gray' > 0x</ code >
@@ -68,10 +66,10 @@ export const CidInfo: React.FC<CidInfoProps> = ({ cid, className, ...props }) =>
6866 { t ( 'CidInfo.hashDigest' ) }
6967 </ label >
7068 < div className = 'tl lh-copy' >
71- < a className = 'db orange no-underline pt2' href = 'https://docs.ipfs.io/concepts/glossary/#multicodec' rel = 'external' target = '_external' title = " Multicodec" >
69+ < DocLink term = 'multicodec' className = 'db orange no-underline pt2' title = ' Multicodec' >
7270 < code className = 'gray' > 0x</ code >
7371 < code > { cidInfo . hashFnCode } </ code > = { cidInfo . hashFn }
74- </ a >
72+ </ DocLink >
7573 < div id = 'CidInfo-multihash' className = 'green' >
7674 < code className = 'gray' > 0x</ code >
7775 < code > { cidInfo . hashLengthCode } </ code > = { cidInfo . hashLengthInBits } bits
0 commit comments