@@ -323,7 +323,12 @@ function getPersonalityTags(
323323// DashboardClient Component
324324// ------------------------------------------------------------
325325
326- export default function DashboardClient ( { initialData, username, compareData = null , } : DashboardClientProps ) {
326+ export default function DashboardClient ( {
327+ initialData,
328+ username,
329+ compareData = null ,
330+ period,
331+ } : DashboardClientProps ) {
327332 const [ secondUserData , setSecondUserData ] = useState < DashboardData | null > ( compareData ) ;
328333 const [ isCompareMode , setIsCompareMode ] = useState ( Boolean ( compareData ) ) ;
329334 const [ isModalOpen , setIsModalOpen ] = useState ( false ) ;
@@ -428,9 +433,7 @@ export default function DashboardClient({ initialData, username, compareData = n
428433 setSecondUserData ( data ) ;
429434 setIsCompareMode ( true ) ;
430435
431- router . replace (
432- `/dashboard/${ username } ?compare=${ data . profile . username } `
433- ) ;
436+ router . replace ( `/dashboard/${ username } ?compare=${ data . profile . username } ` ) ;
434437
435438 setIsModalOpen ( false ) ;
436439 toast . success ( `Comparing ${ username } vs ${ data . profile . username } ` ) ;
@@ -453,25 +456,25 @@ export default function DashboardClient({ initialData, username, compareData = n
453456 } ;
454457
455458 const handleShareComparison = async ( ) => {
456- if ( ! secondUserData ) return ;
459+ if ( ! secondUserData ) return ;
457460
458- const compareUrl = `${ window . location . origin } /dashboard/${ username } ?compare=${ secondUserData . profile . username } ` ;
461+ const compareUrl = `${ window . location . origin } /dashboard/${ username } ?compare=${ secondUserData . profile . username } ` ;
459462
460- try {
461- if ( navigator . share ) {
462- await navigator . share ( {
463- title : `${ username } vs ${ secondUserData . profile . username } ` ,
464- text : 'Check out this GitHub profile comparison' ,
465- url : compareUrl ,
466- } ) ;
467- } else {
468- await navigator . clipboard . writeText ( compareUrl ) ;
469- toast . success ( 'Comparison link copied!' ) ;
463+ try {
464+ if ( navigator . share ) {
465+ await navigator . share ( {
466+ title : `${ username } vs ${ secondUserData . profile . username } ` ,
467+ text : 'Check out this GitHub profile comparison' ,
468+ url : compareUrl ,
469+ } ) ;
470+ } else {
471+ await navigator . clipboard . writeText ( compareUrl ) ;
472+ toast . success ( 'Comparison link copied!' ) ;
473+ }
474+ } catch {
475+ // user cancelled share dialog
470476 }
471- } catch {
472- // user cancelled share dialog
473- }
474- } ;
477+ } ;
475478
476479 // ------------------------------------------------------------
477480 // Compare Mode Statistics Calculations
@@ -599,12 +602,11 @@ export default function DashboardClient({ initialData, username, compareData = n
599602 onClick = { handleShareComparison }
600603 className = "flex items-center gap-2 rounded-xl border border-black/10 dark:border-[rgba(255,255,255,0.15)] bg-blue-600 hover:bg-blue-700 px-4 py-2 text-sm font-semibold text-white transition-all duration-200 active:scale-[0.98]"
601604 >
602- < Share2 size = { 16 } />
603- Share Comparison
605+ < Share2 size = { 16 } />
606+ Share Comparison
604607 </ button >
605608 ) }
606609
607-
608610 < RefreshButton username = { username } />
609611 < button
610612 onClick = { ( ) => {
0 commit comments