|
1 | | -"use client" |
| 1 | +"use client"; |
2 | 2 |
|
3 | | -import * as React from "react" |
4 | | -import * as RadioGroupPrimitive from "@radix-ui/react-radio-group" |
5 | | -import { Circle } from "lucide-react" |
| 3 | +import * as React from "react"; |
| 4 | +import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"; |
| 5 | +import {Circle} from "lucide-react"; |
6 | 6 |
|
7 | | -import { cn } from "@/lib/utils" |
| 7 | +import {cn} from "@/lib/utils"; |
8 | 8 |
|
9 | 9 | const RadioGroup = React.forwardRef< |
10 | 10 | React.ElementRef<typeof RadioGroupPrimitive.Root>, |
11 | 11 | React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> |
12 | | ->(({ className, ...props }, ref) => { |
13 | | - return ( |
14 | | - <RadioGroupPrimitive.Root |
15 | | - className={cn("grid gap-2", className)} |
16 | | - {...props} |
17 | | - ref={ref} |
18 | | - /> |
19 | | - ) |
20 | | -}) |
21 | | -RadioGroup.displayName = RadioGroupPrimitive.Root.displayName |
| 12 | +>(({className, ...props}, ref) => { |
| 13 | + return <RadioGroupPrimitive.Root className={cn("grid gap-2", className)} {...props} ref={ref} />; |
| 14 | +}); |
| 15 | + |
| 16 | +RadioGroup.displayName = RadioGroupPrimitive.Root.displayName; |
22 | 17 |
|
23 | 18 | const RadioGroupItem = React.forwardRef< |
24 | 19 | React.ElementRef<typeof RadioGroupPrimitive.Item>, |
25 | 20 | React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item> |
26 | | ->(({ className, ...props }, ref) => { |
| 21 | +>(({className, ...props}, ref) => { |
27 | 22 | return ( |
28 | 23 | <RadioGroupPrimitive.Item |
29 | 24 | ref={ref} |
30 | 25 | className={cn( |
31 | 26 | "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", |
32 | | - className |
| 27 | + className, |
33 | 28 | )} |
34 | 29 | {...props} |
35 | 30 | > |
36 | 31 | <RadioGroupPrimitive.Indicator className="flex items-center justify-center"> |
37 | 32 | <Circle className="h-2.5 w-2.5 fill-current text-current" /> |
38 | 33 | </RadioGroupPrimitive.Indicator> |
39 | 34 | </RadioGroupPrimitive.Item> |
40 | | - ) |
41 | | -}) |
42 | | -RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName |
| 35 | + ); |
| 36 | +}); |
| 37 | + |
| 38 | +RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName; |
43 | 39 |
|
44 | | -export { RadioGroup, RadioGroupItem } |
| 40 | +export {RadioGroup, RadioGroupItem}; |
0 commit comments