1
- import { Retrospective } from '@prisma/client'
1
+ import { Prisma } from '@prisma/client'
2
+ import { IconArrowRight , IconUser } from '@tabler/icons-react'
3
+ import { MessageCircle } from 'lucide-react'
2
4
import Link from 'next/link'
3
5
4
6
import { EditRetro } from '@/app/dashboard/retros/components/edit-retro'
7
+ import { Button } from '@/app/ui/button/button'
5
8
import {
6
9
Card ,
10
+ CardContent ,
7
11
CardDescription ,
8
12
CardHeader ,
9
13
CardTitle ,
10
14
} from '@/app/ui/card/card'
11
15
import { RetrospectiveUpdateInput } from '@/types/retrospective'
12
16
import { formatDate } from '@/utils/utils'
13
17
18
+ type RetroWithRelations = Prisma . RetrospectiveGetPayload < {
19
+ include : {
20
+ items : true
21
+ participants : true
22
+ }
23
+ } >
24
+
14
25
type RetroCardProps = {
15
- retrospective : Retrospective
26
+ retrospective : RetroWithRelations
16
27
handleUpdateRetro : ( input : RetrospectiveUpdateInput ) => void
17
28
}
18
29
@@ -23,7 +34,7 @@ export function RetroCard({
23
34
return (
24
35
< Card
25
36
key = { retrospective . id }
26
- className = 'h-full w-full shadow-sm transition ease-in-out hover:scale-105 '
37
+ className = 'h-full w-full shadow-sm transition duration-200 ease-in-out hover:ring-2 hover:ring-primary hover:ring-offset-2 dark:hover:ring-secondary '
27
38
>
28
39
< CardHeader >
29
40
< CardTitle className = 'flex items-baseline justify-between' >
@@ -35,19 +46,41 @@ export function RetroCard({
35
46
</ CardTitle >
36
47
< CardDescription > { formatDate ( retrospective . date ) } </ CardDescription >
37
48
</ CardHeader >
38
- < Link
39
- className = 'hover:cursor-pointer'
40
- href = { {
41
- pathname : '/retro' ,
42
- query : {
43
- id : retrospective . id ,
44
- name : retrospective . name ,
45
- } ,
46
- } }
47
- aria-label = 'Go to retro view'
48
- >
49
- < div className = 'pattern-cross h-28 pattern-bg-transparent pattern-foreground pattern-opacity-5 pattern-size-4' />
50
- </ Link >
49
+
50
+ < CardContent className = 'flex justify-between text-muted-foreground' >
51
+ < div className = 'flex flex-col gap-2' >
52
+ < p className = 'flex items-center gap-2' >
53
+ < IconUser size = { 18 } />
54
+ { retrospective . participants . length }
55
+ < p > Participants</ p >
56
+ </ p >
57
+ < p className = 'flex items-center gap-2' >
58
+ < MessageCircle size = { 18 } />
59
+ { retrospective . items . length }
60
+ < p > Feedback items</ p >
61
+ </ p >
62
+ </ div >
63
+ < Button
64
+ variant = 'link'
65
+ size = 'lg'
66
+ className = 'self-end justify-self-end pr-0'
67
+ >
68
+ < Link
69
+ className = 'flex items-center'
70
+ href = { {
71
+ pathname : '/retro' ,
72
+ query : {
73
+ id : retrospective . id ,
74
+ name : retrospective . name ,
75
+ } ,
76
+ } }
77
+ aria-label = 'Go to retro view'
78
+ >
79
+ Open
80
+ < IconArrowRight size = { 18 } />
81
+ </ Link >
82
+ </ Button >
83
+ </ CardContent >
51
84
</ Card >
52
85
)
53
86
}
0 commit comments