mirror of
https://github.com/kremalicious/blog.git
synced 2025-02-14 21:10:25 +01:00
32 lines
615 B
TypeScript
32 lines
615 B
TypeScript
import React, { ReactElement } from 'react'
|
|
import { QRCode } from 'react-qr-svg'
|
|
import styles from './Qr.module.scss'
|
|
import Copy from './Copy'
|
|
|
|
export default function Qr({
|
|
address,
|
|
title
|
|
}: {
|
|
address: string
|
|
title?: string
|
|
}): ReactElement {
|
|
return (
|
|
<>
|
|
{title && <h4>{title}</h4>}
|
|
<QRCode
|
|
bgColor="transparent"
|
|
fgColor="#6b7f88"
|
|
level="Q"
|
|
style={{ width: 120 }}
|
|
value={address}
|
|
className={styles.qr}
|
|
/>
|
|
|
|
<pre className={styles.code}>
|
|
<code>{address}</code>
|
|
<Copy text={address} />
|
|
</pre>
|
|
</>
|
|
)
|
|
}
|