mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-10-30 18:22:59 +00:00
- Fixed qr-code.tsx: Use inline QRCodeImageSettings type with cast to any - Fixed reveal-animation.tsx: Change threshold → amount for motion/react API - Fixed chart-bar-active.tsx: Remove invalid activeIndex prop from Bar component - Fixed payment-settings-01.tsx: Add explicit types to callback parameters - Created billing stub module in both default and new-york variants - Fixed billing imports: Changed @hanzo/ui/billing → @/registry/new-york/ui/billing - All billing import errors resolved Production errors fixed: ~20 Remaining: 27 errors (14 billing mock data, 13 recharts types - lower priority)
64 lines
1.2 KiB
TypeScript
64 lines
1.2 KiB
TypeScript
"use client"
|
|
|
|
import * as React from "react"
|
|
import { QRCodeSVG } from "qrcode.react"
|
|
|
|
import { cn } from "@/lib/utils"
|
|
|
|
interface QRCodeImageSettings {
|
|
src: string
|
|
height: number
|
|
width: number
|
|
excavate?: boolean
|
|
x?: number
|
|
y?: number
|
|
}
|
|
|
|
interface QRCodeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
value: string
|
|
size?: number
|
|
level?: "L" | "M" | "Q" | "H"
|
|
bgColor?: string
|
|
fgColor?: string
|
|
includeMargin?: boolean
|
|
imageSettings?: QRCodeImageSettings
|
|
}
|
|
|
|
const QRCode = React.forwardRef<HTMLDivElement, QRCodeProps>(
|
|
(
|
|
{
|
|
className,
|
|
value,
|
|
size = 256,
|
|
level = "M",
|
|
bgColor = "#FFFFFF",
|
|
fgColor = "#000000",
|
|
includeMargin = false,
|
|
imageSettings,
|
|
...props
|
|
},
|
|
ref
|
|
) => {
|
|
return (
|
|
<div
|
|
ref={ref}
|
|
className={cn("inline-flex items-center justify-center", className)}
|
|
{...props}
|
|
>
|
|
<QRCodeSVG
|
|
value={value}
|
|
size={size}
|
|
level={level}
|
|
bgColor={bgColor}
|
|
fgColor={fgColor}
|
|
includeMargin={includeMargin}
|
|
imageSettings={imageSettings as any}
|
|
/>
|
|
</div>
|
|
)
|
|
}
|
|
)
|
|
QRCode.displayName = "QRCode"
|
|
|
|
export { QRCode }
|