11import React , { useState } from 'react' ;
22import Image from 'next/image' ;
3- // import { Github, Twitter, Linkedin } from 'lucide-react';
43
5- // Define the types for the `ambassador` prop
64interface Contribution {
75 title : string ;
8- date ?: { month : string ; year : number } ;
6+ date ?: {
7+ month : string ;
8+ year : number ;
9+ } ;
910 link : string ;
1011 type : string ;
1112}
1213
13- interface Ambassador {
14+ export interface Ambassador {
1415 img ?: string ;
1516 name ?: string ;
1617 title ?: string ;
@@ -24,29 +25,23 @@ interface Ambassador {
2425 contributions ?: Contribution [ ] ;
2526}
2627
27- interface AmbassadorCardProps {
28- ambassador : Ambassador ;
29- }
30-
31- type SocialPlatform = 'github' | 'twitter' | 'mastodon' | 'linkedin' ;
28+ type SocialIcons = 'github' | 'twitter' | 'mastodon' | 'linkedin' ;
3229
33- // Utility function to generate full URLs for social media
3430const getSocialMediaUrl = (
35- platform : SocialPlatform ,
31+ platform : SocialIcons ,
3632 username : string | undefined ,
3733) => {
38- const baseUrls : Record < SocialPlatform , string > = {
34+ const baseUrls : Record < SocialIcons , string > = {
3935 github : 'https://github.com/' ,
4036 twitter : 'https://twitter.com/' ,
41- mastodon : 'https://mastodon.social /' ,
37+ mastodon : 'https://fosstodon.org /' ,
4238 linkedin : 'https://www.linkedin.com/in/' ,
4339 } ;
4440 return username ? baseUrls [ platform ] + username : undefined ;
4541} ;
4642
47- // Social media icon component with proper typing
48- const SocialIcon : React . FC < { platform : SocialPlatform } > = ( { platform } ) => {
49- const icons : Record < SocialPlatform , JSX . Element > = {
43+ const SocialIcon = ( { platform } : { platform : SocialIcons } ) => {
44+ const icons : Record < SocialIcons , JSX . Element > = {
5045 github : (
5146 < svg
5247 className = 'w-7 h-7 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100'
@@ -70,11 +65,24 @@ const SocialIcon: React.FC<{ platform: SocialPlatform }> = ({ platform }) => {
7065 linkedin : (
7166 < svg
7267 className = 'w-7 h-7 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100'
73- viewBox = '0 0 24 24 '
68+ viewBox = '0 0 310 310 '
7469 fill = 'currentColor'
7570 xmlns = 'http://www.w3.org/2000/svg'
7671 >
77- < path d = 'M22.225 0H1.771C.792 0 0 .775 0 1.729V22.27c0 .955.793 1.729 1.771 1.729h20.451c.978 0 1.778-.775 1.778-1.729V1.729C24 .774 23.203 0 22.225 0zM7.113 20.452H3.56V8.997h3.552v11.455zm-1.78-13.044a2.073 2.073 0 1 1 0-4.145 2.073 2.073 0 0 1 0 4.145zm15.34 13.044h-3.552v-5.697c0-1.357-.027-3.1-1.892-3.1-1.892 0-2.182 1.48-2.182 3.003v5.794H10.84V8.997h3.412v1.568h.049c.474-.896 1.637-1.84 3.37-1.84 3.604 0 4.268 2.371 4.268 5.451v6.276h-.002z' />
72+ < path
73+ d = 'M72.16,99.73H9.927c-2.762,0-5,2.239-5,5v199.928c0,2.762,2.238,5,5,5H72.16c2.762,0,5-2.238,5-5V104.73
74+ C77.16,101.969,74.922,99.73,72.16,99.73z'
75+ />
76+ < path
77+ d = 'M41.066,0.341C18.422,0.341,0,18.743,0,41.362C0,63.991,18.422,82.4,41.066,82.4
78+ c22.626,0,41.033-18.41,41.033-41.038C82.1,18.743,63.692,0.341,41.066,0.341z'
79+ />
80+ < path
81+ d = 'M230.454,94.761c-24.995,0-43.472,10.745-54.679,22.954V104.73c0-2.761-2.238-5-5-5h-59.599
82+ c-2.762,0-5,2.239-5,5v199.928c0,2.762,2.238,5,5,5h62.097c2.762,0,5-2.238,5-5v-98.918c0-33.333,9.054-46.319,32.29-46.319
83+ c25.306,0,27.317,20.818,27.317,48.034v97.204c0,2.762,2.238,5,5,5H305c2.762,0,5-2.238,5-5V194.995
84+ C310,145.43,300.549,94.761,230.454,94.761z'
85+ />
7886 </ svg >
7987 ) ,
8088 mastodon : (
@@ -91,7 +99,7 @@ const SocialIcon: React.FC<{ platform: SocialPlatform }> = ({ platform }) => {
9199 return icons [ platform ] ;
92100} ;
93101
94- const AmbassadorCard : React . FC < AmbassadorCardProps > = ( { ambassador } ) => {
102+ const AmbassadorCard = ( { ambassador } : { ambassador : Ambassador } ) => {
95103 const [ showContributions , setShowContributions ] = useState ( false ) ;
96104 const [ imgSrc , setImgSrc ] = useState (
97105 ambassador . img || '/api/placeholder/400/320' ,
@@ -106,8 +114,7 @@ const AmbassadorCard: React.FC<AmbassadorCardProps> = ({ ambassador }) => {
106114 contributions = [ ] ,
107115 } = ambassador ;
108116
109- // Available social platforms with proper typing
110- const socialPlatforms : SocialPlatform [ ] = [
117+ const SocialIconss : SocialIcons [ ] = [
111118 'github' ,
112119 'twitter' ,
113120 'mastodon' ,
@@ -116,7 +123,6 @@ const AmbassadorCard: React.FC<AmbassadorCardProps> = ({ ambassador }) => {
116123
117124 return (
118125 < div className = 'relative max-w-sm md:max-w-md lg:max-w-lg mx-auto bg-white dark:bg-gray-800 shadow-lg rounded-lg overflow-hidden my-4 transition-all duration-300 h-fit' >
119- { /* Black Borders */ }
120126 < div className = 'absolute top-0 right-0 w-1 h-20 bg-black dark:bg-gray-400' > </ div >
121127 < div className = 'absolute bottom-100 right-0 w-20 h-1 bg-black dark:bg-gray-400' > </ div >
122128 < div className = 'absolute bottom-0 left-0 w-1 h-20 bg-black dark:bg-gray-400' > </ div >
@@ -151,9 +157,8 @@ const AmbassadorCard: React.FC<AmbassadorCardProps> = ({ ambassador }) => {
151157 </ p >
152158 ) }
153159
154- { /* Social Media Links */ }
155160 < div className = 'flex justify-center mb-4' >
156- { socialPlatforms . map ( ( platform ) => {
161+ { SocialIconss . map ( ( platform ) => {
157162 const username = ambassador [ platform ] ;
158163 return username ? (
159164 < a
@@ -170,7 +175,6 @@ const AmbassadorCard: React.FC<AmbassadorCardProps> = ({ ambassador }) => {
170175 } ) }
171176 </ div >
172177
173- { /* Button to Show/Hide Contributions */ }
174178 { contributions . length > 0 && (
175179 < button
176180 onClick = { ( ) => setShowContributions ( ! showContributions ) }
@@ -182,7 +186,6 @@ const AmbassadorCard: React.FC<AmbassadorCardProps> = ({ ambassador }) => {
182186 </ button >
183187 ) }
184188
185- { /* Contributions Section (Toggled) */ }
186189 { showContributions && contributions . length > 0 && (
187190 < div className = 'mt-4' >
188191 < h4 className = 'text-lg font-semibold mb-2 text-gray-900 dark:text-white' >
0 commit comments