1- ' use client'
1+ " use client" ;
22import Link from "next/link" ;
33import React from "react" ;
4- import { useState } from ' react' ;
4+ import { useState } from " react" ;
55import github from "../../../../public/images/social-media/github.png" ;
66import docs from "../../../../public/images/social-media/docs.svg" ;
77import Image from "next/image" ;
@@ -28,7 +28,7 @@ export default function ProjectCard({
2828} : Props ) {
2929 const [ showAllTags , setShowAllTags ] = useState ( false ) ;
3030 const [ expandDescription , setExpandDescription ] = useState ( false ) ;
31-
31+
3232 return (
3333 < div className = 'border-2 p-8 transition-[box-shadow] shadow-none hover:shadow-xl bg-slate-50/70 max-w-full h-64 flex flex-col relative' >
3434 { /* Top content section */ }
@@ -44,44 +44,52 @@ export default function ProjectCard({
4444 </ div >
4545 ) }
4646 </ div >
47-
47+
4848 { /*Description that expands on click */ }
49- < div
50- className = { `mb-3 relative cursor-pointer ${ expandDescription ? 'max-h-[72px] overflow-y-auto' : '' } ` }
49+ < div
50+ className = { `mb-3 relative cursor-pointer ${
51+ expandDescription ? "max-h-[72px] overflow-y-auto" : ""
52+ } `}
5153 onClick = { ( ) => setExpandDescription ( ! expandDescription ) }
5254 >
53- < p className = { `text-mf-dark tracking-wide leading-6 ${ expandDescription ? '' : 'line-clamp-3' } ` } >
55+ < p
56+ className = { `text-mf-dark tracking-wide leading-6 ${
57+ expandDescription ? "" : "line-clamp-3"
58+ } `}
59+ >
5460 { shortDescription }
5561 </ p >
5662 { expandDescription && (
57- < span className = " text-xs text-blue-500 mt-1 block" > less</ span >
63+ < span className = ' text-xs text-blue-500 mt-1 block' > less</ span >
5864 ) }
5965 </ div >
60-
66+
6167 { parentTitle !== "Upcoming Projects" && tags && tags . length > 0 && (
6268 < div className = 'mb-2' >
63- < div className = { `flex gap-2 max-w-full ${ showAllTags ? 'overflow-x-auto pb-2' : 'overflow-hidden' } ` } >
64- { showAllTags ? (
65- tags . map ( ( tag , index ) => (
66- < span
67- key = { index }
68- className = 'px-2 py-1 text-xs bg-gray-100 text-gray-600 rounded-full border border-red-500 truncate flex-shrink-0'
69- >
70- { tag }
71- </ span >
72- ) )
73- ) : (
74- tags . slice ( 0 , 2 ) . map ( ( tag , index ) => (
75- < span
76- key = { index }
77- className = 'px-2 py-1 text-xs bg-gray-100 text-gray-600 rounded-full border border-red-500 truncate max-w-[100px]'
78- >
79- { tag }
80- </ span >
81- ) )
82- ) }
69+ < div
70+ className = { `flex gap-2 max-w-full ${
71+ showAllTags ? "overflow-x-auto pb-2" : "overflow-hidden"
72+ } `}
73+ >
74+ { showAllTags
75+ ? tags . map ( ( tag , index ) => (
76+ < span
77+ key = { index }
78+ className = 'px-2 py-1 text-xs bg-gray-100 text-gray-600 rounded-full border border-red-500 truncate flex-shrink-0'
79+ >
80+ { tag }
81+ </ span >
82+ ) )
83+ : tags . slice ( 0 , 2 ) . map ( ( tag , index ) => (
84+ < span
85+ key = { index }
86+ className = 'px-2 py-1 text-xs bg-gray-100 text-gray-600 rounded-full border border-red-500 truncate max-w-[100px]'
87+ >
88+ { tag }
89+ </ span >
90+ ) ) }
8391 { ! showAllTags && tags . length > 2 && (
84- < button
92+ < button
8593 onClick = { ( e ) => {
8694 e . stopPropagation ( ) ;
8795 setShowAllTags ( true ) ;
@@ -92,7 +100,7 @@ export default function ProjectCard({
92100 </ button >
93101 ) }
94102 { showAllTags && (
95- < button
103+ < button
96104 onClick = { ( e ) => {
97105 e . stopPropagation ( ) ;
98106 setShowAllTags ( false ) ;
@@ -106,7 +114,7 @@ export default function ProjectCard({
106114 </ div >
107115 ) }
108116 </ div >
109-
117+
110118 { /* Footer section */ }
111119 { parentTitle !== "Upcoming Projects" &&
112120 ( githubUrl || documentationUrl ) &&
@@ -136,7 +144,12 @@ export default function ProjectCard({
136144 target = '_blank'
137145 className = 'flex items-center gap-2 px-3 py-1.5 rounded-full bg-gray-100 hover:bg-gray-200 transition-colors'
138146 >
139- < Image src = { docs } height = { 20 } width = { 20 } alt = 'Documentation' />
147+ < Image
148+ src = { docs }
149+ height = { 20 }
150+ width = { 20 }
151+ alt = 'Documentation'
152+ />
140153 < span className = 'text-sm text-gray-600' > Docs</ span >
141154 </ Link >
142155 ) }
@@ -145,5 +158,4 @@ export default function ProjectCard({
145158 ) }
146159 </ div >
147160 ) ;
148-
149161}
0 commit comments