1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-06-10 20:00:09 +02:00
blog/src/components/atoms/Qr.tsx
2021-03-14 01:34:04 +01:00

32 lines
606 B
TypeScript

import React, { ReactElement } from 'react'
import { QRCode } from 'react-qr-svg'
import { qr, code } from './Qr.module.css'
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={qr}
/>
<pre className={code}>
<code>{address}</code>
<Copy text={address} />
</pre>
</>
)
}