1- import { ArrowRight , HandCoins , Triangle , Trophy } from 'lucide-react' ;
1+ 'use client' ;
2+
3+ import { ArrowRight , HandCoins , Trophy } from 'lucide-react' ;
24import Image from 'next/image' ;
35import { useRouter } from 'next/navigation' ;
6+ import {
7+ Tooltip ,
8+ TooltipContent ,
9+ TooltipProvider ,
10+ TooltipTrigger ,
11+ } from '@/components/ui/tooltip' ;
412
513interface OrganizationCardProps {
614 id : string ;
@@ -27,97 +35,72 @@ export default function OrganizationCard({
2735} : OrganizationCardProps ) {
2836 const router = useRouter ( ) ;
2937 return (
30- < section
31- onClick = { ( ) => router . push ( `/organizations/ ${ id } /settings` ) }
32- className = 'hover:shadow-primary/10 cursor-pointer rounded-xl border border-zinc-800 bg-black transition-shadow duration-300 hover:shadow-lg'
33- >
34- < div className = 'rounded-xl border border-zinc-800 bg-zinc-900 px-4 pt-4 pb-1 md:px-6 md:pt-6' >
35- < div className = 'mb-6 flex items-start gap -4' >
36- < div className = 'flex h-14 w-14 flex-shrink-0 items-center justify-center rounded-lg ' >
38+ < TooltipProvider >
39+ < section
40+ onClick = { ( ) => router . push ( `/organizations/ ${ id } /settings` ) }
41+ className = 'hover:shadow-primary/10 cursor-pointer rounded-lg border border-zinc-800 bg-black transition-shadow duration-300 hover:shadow-lg'
42+ >
43+ < div className = 'flex items-center justify-between rounded-lg border border-zinc-800 bg-zinc-900 px-4 py-3 md:px-5 md:py -4' >
44+ < div className = 'flex min-w-0 flex-1 items-center gap-3 ' >
3745 < Image
38- src = { logo }
46+ src = { logo || '/placeholder.svg' }
3947 alt = { `${ name } Logo` }
40- width = { 56 }
41- height = { 56 }
42- className = 'rounded-lg object-contain'
48+ width = { 40 }
49+ height = { 40 }
50+ className = 'flex-shrink-0 rounded-lg object-contain'
4351 />
44- </ div >
45- < div className = 'min-w-0 flex-1' >
46- < h3 className = 'mb-1 text-lg font-semibold text-white' > { name } </ h3 >
47- < p className = 'text-sm text-zinc-500' >
48- Created { new Date ( createdAt ) . toLocaleDateString ( ) }
49- </ p >
50- </ div >
51- </ div >
52-
53- < div className = 'mb-6 grid grid-cols-2 gap-4' >
54- < div className = 'rounded-lg border border-zinc-800 bg-black p-2.5 md:p-4' >
55- < div className = 'mb-2 flex items-center gap-2' >
56- < div className = 'bg-active-bg grid max-h-7 min-h-7 max-w-7 min-w-7 place-content-center rounded-lg border-[0.5px] border-[rgba(167,249,80,0.24)] md:h-10 md:w-10' >
57- < Trophy className = 'text-primary h-3 w-3 md:h-4 md:w-4' />
58- </ div >
59- < span className = 'text-xs font-medium text-white sm:text-sm' >
60- Hackathons
61- </ span >
62- </ div >
63- < div className = 'my-2 text-2xl font-semibold text-white' >
64- { hackathons . count }
65- </ div >
66- < div className = 'mb-2 flex items-center gap-1 text-xs text-zinc-500' >
67- { hackathons . submissions > 5 ? (
68- < Triangle
69- className = 'h-3 w-3 border-0 text-[#40b869] md:h-4 md:w-4'
70- fill = '#40b869'
71- />
72- ) : (
73- < Triangle
74- className = 'h-3 w-3 rotate-180 border-0 text-[#dd514d] md:h-4 md:w-4'
75- fill = '#dd514d'
76- />
77- ) }
78- < span >
79- { hackathons . submissions } submission
80- { hackathons . submissions !== 1 ? 's' : '' }
81- </ span >
52+ < div className = 'min-w-0' >
53+ < h3 className = 'truncate text-sm font-semibold text-white' >
54+ { name }
55+ </ h3 >
56+ < p className = 'text-xs text-zinc-500' >
57+ { new Date ( createdAt ) . toLocaleDateString ( ) }
58+ </ p >
8259 </ div >
8360 </ div >
8461
85- < div className = 'rounded-lg border border-zinc-800 bg-black p-2.5 md:p-4' >
86- < div className = 'mb-2 flex items-center gap-2' >
87- < div className = 'bg-active-bg grid h-7 w-7 place-content-center rounded-lg border-[0.5px] border-[rgba(167,249,80,0.24)] md:h-10 md:w-10' >
88- < HandCoins className = 'text-primary h-3 w-3 md:h-4 md:w-4' />
89- </ div >
90- < span className = 'text-xs font-medium text-white sm:text-sm' >
91- Grants
92- </ span >
93- </ div >
94- < div className = 'my-2 text-2xl font-semibold text-white' >
95- { grants . count }
96- </ div >
97- < div className = 'mb-2 flex items-center gap-1 text-xs text-zinc-500' >
98- { grants . applications > 5 ? (
99- < Triangle
100- className = 'h-3 w-3 border-0 text-[#40b869] md:h-4 md:w-4'
101- fill = '#40b869'
102- />
103- ) : (
104- < Triangle
105- className = 'h-3 w-3 rotate-180 border-0 text-[#dd514d] md:h-4 md:w-4'
106- fill = '#dd514d'
107- />
108- ) }
109- < span >
110- { grants . applications } application
111- { grants . applications !== 1 ? 's' : '' }
112- </ span >
113- </ div >
62+ < div className = 'ml-4 flex items-center gap-2' >
63+ < Tooltip >
64+ < TooltipTrigger asChild >
65+ < div className = 'flex cursor-help items-center gap-1.5 rounded-lg border border-zinc-800 bg-black px-2.5 py-1.5 transition-colors hover:border-lime-500/50' >
66+ < div className = 'bg-active-bg grid h-5 w-5 place-content-center rounded border-[0.5px] border-[rgba(167,249,80,0.24)]' >
67+ < Trophy className = 'text-primary h-2.5 w-2.5' />
68+ </ div >
69+ < span className = 'text-xs font-medium text-white' >
70+ { hackathons . count }
71+ </ span >
72+ </ div >
73+ </ TooltipTrigger >
74+ < TooltipContent >
75+ < p className = 'text-xs' >
76+ { hackathons . count } hackathons ({ hackathons . submissions } { ' ' }
77+ submissions)
78+ </ p >
79+ </ TooltipContent >
80+ </ Tooltip >
81+
82+ < Tooltip >
83+ < TooltipTrigger asChild >
84+ < div className = 'flex cursor-help items-center gap-1.5 rounded-lg border border-zinc-800 bg-black px-2.5 py-1.5 transition-colors hover:border-lime-500/50' >
85+ < div className = 'bg-active-bg grid h-5 w-5 place-content-center rounded border-[0.5px] border-[rgba(167,249,80,0.24)]' >
86+ < HandCoins className = 'text-primary h-2.5 w-2.5' />
87+ </ div >
88+ < span className = 'text-xs font-medium text-white' >
89+ { grants . count }
90+ </ span >
91+ </ div >
92+ </ TooltipTrigger >
93+ < TooltipContent >
94+ < p className = 'text-xs' >
95+ { grants . count } grants ({ grants . applications } applications)
96+ </ p >
97+ </ TooltipContent >
98+ </ Tooltip >
99+
100+ < ArrowRight className = 'text-primary ml-2 h-4 w-4 flex-shrink-0' />
114101 </ div >
115102 </ div >
116- </ div >
117- < span className = 'text-primary flex items-center justify-end gap-2 px-10 py-5 text-sm font-medium transition-colors hover:text-lime-400' >
118- < span > Manage Organization</ span >
119- < ArrowRight className = 'h-4 w-4' />
120- </ span >
121- </ section >
103+ </ section >
104+ </ TooltipProvider >
122105 ) ;
123106}
0 commit comments