fix ref type error

This commit is contained in:
miloschwartz 2025-04-12 19:57:37 -04:00
parent 419e576a3e
commit 2398931cc1
No known key found for this signature in database
28 changed files with 1764 additions and 2011 deletions

View file

@ -6,15 +6,10 @@ import { Circle } from "lucide-react"
import { cn } from "@app/lib/cn"
const RadioGroup = (
{
ref,
className,
...props
}: React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> & {
ref: React.RefObject<React.ElementRef<typeof RadioGroupPrimitive.Root>>;
}
) => {
const RadioGroup = React.forwardRef<
React.ElementRef<typeof RadioGroupPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
>(({ className, ...props }, ref) => {
return (
<RadioGroupPrimitive.Root
className={cn("grid gap-2", className)}
@ -22,23 +17,18 @@ const RadioGroup = (
ref={ref}
/>
)
}
})
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName
const RadioGroupItem = (
{
ref,
className,
...props
}: React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item> & {
ref: React.RefObject<React.ElementRef<typeof RadioGroupPrimitive.Item>>;
}
) => {
const RadioGroupItem = React.forwardRef<
React.ElementRef<typeof RadioGroupPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
>(({ className, ...props }, ref) => {
return (
<RadioGroupPrimitive.Item
ref={ref}
className={cn(
"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
className
)}
{...props}
@ -48,7 +38,7 @@ const RadioGroupItem = (
</RadioGroupPrimitive.Indicator>
</RadioGroupPrimitive.Item>
)
}
})
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName
export { RadioGroup, RadioGroupItem }