Added QR component

This commit is contained in:
Patrick Alvin Alcala 2025-09-25 18:06:03 +08:00
parent 30b159ce7c
commit ca1024c343
2 changed files with 20 additions and 0 deletions

19
src/components/QR/QR.tsx Normal file
View file

@ -0,0 +1,19 @@
// @ts-ignore
import { useQRCode } from '@solidjs-use/integrations/useQRCode'
interface Props {
value: string
width?: number
}
export default (props: Props) => {
const qrcode = useQRCode(props.value)
return (
<>
<section>
<img src={qrcode()} alt="QR Code" style={`width: ${props.width || 'auto' }rem`}/>
</section>
</>
)
}

View file

@ -17,6 +17,7 @@ export { default as Modal } from './Modal/Modal'
export { default as Table } from './Table/Table'
export { default as Combobox } from './Combobox/Combobox'
export { default as File } from './File/File'
export { default as QR } from './QR/QR'
// export { default as OptimizeBackground } from './Optimizers/OptimizeBackground'
// export { default as OptimizeImage } from './Optimizers/OptimizeImage'