@@ -2,42 +2,30 @@ import * as React from 'react';
22
33import { cn } from '@o2s/ui/lib/utils' ;
44
5- const Card = React . forwardRef < HTMLDivElement , React . HTMLAttributes < HTMLDivElement > > ( ( { className, ...props } , ref ) => (
5+ type CardProps = React . HTMLAttributes < HTMLDivElement > & { ref ?: React . Ref < HTMLDivElement > } ;
6+ const Card = ( { className, ref, ...props } : CardProps ) => (
67 < div ref = { ref } className = { cn ( 'rounded-lg border bg-card text-card-foreground shadow-xs' , className ) } { ...props } />
7- ) ) ;
8- Card . displayName = 'Card' ;
8+ ) ;
99
10- const CardHeader = React . forwardRef < HTMLDivElement , React . HTMLAttributes < HTMLDivElement > > (
11- ( { className, ...props } , ref ) => (
12- < div ref = { ref } className = { cn ( 'flex flex-col space-y-1.5 p-6 pb-0' , className ) } { ...props } />
13- ) ,
10+ type CardSectionProps = React . HTMLAttributes < HTMLDivElement > & { ref ?: React . Ref < HTMLDivElement > } ;
11+ const CardHeader = ( { className, ref, ...props } : CardSectionProps ) => (
12+ < div ref = { ref } className = { cn ( 'flex flex-col space-y-1.5 p-6 pb-0' , className ) } { ...props } />
1413) ;
15- CardHeader . displayName = 'CardHeader' ;
1614
17- const CardTitle = React . forwardRef < HTMLDivElement , React . HTMLAttributes < HTMLDivElement > > (
18- ( { className, ...props } , ref ) => (
19- < div ref = { ref } className = { cn ( 'text-2xl font-semibold leading-none tracking-tight' , className ) } { ...props } />
20- ) ,
15+ const CardTitle = ( { className, ref, ...props } : CardSectionProps ) => (
16+ < div ref = { ref } className = { cn ( 'text-2xl font-semibold leading-none tracking-tight' , className ) } { ...props } />
2117) ;
22- CardTitle . displayName = 'CardTitle' ;
2318
24- const CardDescription = React . forwardRef < HTMLDivElement , React . HTMLAttributes < HTMLDivElement > > (
25- ( { className, ...props } , ref ) => (
26- < div ref = { ref } className = { cn ( 'text-sm text-muted-foreground' , className ) } { ...props } />
27- ) ,
19+ const CardDescription = ( { className, ref, ...props } : CardSectionProps ) => (
20+ < div ref = { ref } className = { cn ( 'text-sm text-muted-foreground' , className ) } { ...props } />
2821) ;
29- CardDescription . displayName = 'CardDescription' ;
3022
31- const CardContent = React . forwardRef < HTMLDivElement , React . HTMLAttributes < HTMLDivElement > > (
32- ( { className , ... props } , ref ) => < div ref = { ref } className = { cn ( 'p-6' , className ) } { ...props } /> ,
23+ const CardContent = ( { className , ref , ... props } : CardSectionProps ) => (
24+ < div ref = { ref } className = { cn ( 'p-6' , className ) } { ...props } />
3325) ;
34- CardContent . displayName = 'CardContent' ;
3526
36- const CardFooter = React . forwardRef < HTMLDivElement , React . HTMLAttributes < HTMLDivElement > > (
37- ( { className, ...props } , ref ) => (
38- < div ref = { ref } className = { cn ( 'flex items-center p-6 pt-0' , className ) } { ...props } />
39- ) ,
27+ const CardFooter = ( { className, ref, ...props } : CardSectionProps ) => (
28+ < div ref = { ref } className = { cn ( 'flex items-center p-6 pt-0' , className ) } { ...props } />
4029) ;
41- CardFooter . displayName = 'CardFooter' ;
4230
4331export { Card , CardHeader , CardFooter , CardTitle , CardDescription , CardContent } ;
0 commit comments