@@ -12,6 +12,7 @@ import { useState } from 'react';
1212import { generateAIDescription_Public } from '../services/aiService' ;
1313import toast from 'react-hot-toast' ;
1414import Nyra from '../assets/NyraAI.png' ;
15+ import { FiShare2 } from 'react-icons/fi' ;
1516
1617interface Member { id : string ; name : string ; profileImage ?: string | null ; githubLink ?: string ; linkedinLink ?: string ; }
1718interface ProjectMember { id : string ; role : string ; member : Member ; }
@@ -22,6 +23,18 @@ interface AiSummaryProps {
2223 existingAiDescription : string ;
2324}
2425
26+ const onShare = ( ) => {
27+ const shareData = {
28+ title : document . title ,
29+ text : 'Check out this project on MyMind!' ,
30+ url : window . location . href
31+ } ;
32+
33+ navigator . share ( shareData ) . catch ( ( error ) => {
34+ console . error ( 'Error sharing:' , error ) ;
35+ } ) ;
36+ } ;
37+
2538const SummarySkeleton = ( ) => (
2639 < div className = "space-y-3" >
2740 < div className = "h-4 bg-slate-200/80 rounded w-3/4 animate-pulse" > </ div >
@@ -148,9 +161,14 @@ export default function ProjectDetailPage() {
148161 < main className = "sm:px-4 lg:px-6 py-6" >
149162 < div className = "container mx-auto px-6" >
150163 < motion . div initial = { { opacity : 0 , y : 20 } } animate = { { opacity : 1 , y : 0 } } transition = { { duration : 0.5 } } >
151- < div className = "text-center" >
164+ < div className = "flex flex-col items-center text-center" >
152165 < span className = "text-sm font-bold text-blue-600 uppercase tracking-widest" > { project . category . name } </ span >
153- < h1 className = "text-4xl md:text-5xl font-extrabold text-slate-900 mt-2" > { project . name } </ h1 >
166+ < div className = "w-fit relative" >
167+ < h1 className = "text-4xl md:text-5xl font-extrabold text-slate-900 mt-2" > { project . name } </ h1 >
168+ < button onClick = { onShare } className = "cursor-pointer absolute top-1 -right-4 text-slate-500 hover:text-slate-900" title = "Share Project" >
169+ < FiShare2 />
170+ </ button >
171+ </ div >
154172 < p className = "text-slate-500 mt-3 flex items-center justify-center gap-2" >
155173 < FiCalendar />
156174 < span > { formatDate ( project . startDate ) } - { project . endDate ? formatDate ( project . endDate ) : 'Present' } </ span >
0 commit comments