|
1 | | -import { Card, CardHeader, CardBody, CardFooter, Link } from '@nextui-org/react' |
| 1 | +import { Card, CardHeader, CardBody, CardFooter, Link, Skeleton } from '@nextui-org/react' |
2 | 2 | import { FaEnvelope, FaMapMarkerAlt, FaGithub } from 'react-icons/fa' |
3 | 3 | import { BsBuildings, BsTwitterX } from 'react-icons/bs' |
4 | 4 | import { GitHubUserContextProps } from '@/types' |
5 | 5 |
|
6 | 6 | export default function ContactCard({ userData, isLoading, error }: GitHubUserContextProps) { |
7 | | - if (isLoading) return <p>Loading...</p> |
8 | 7 | if (error) return <p>Error: {error}</p> |
9 | 8 |
|
10 | 9 | return ( |
11 | 10 | <Card isHoverable className="flex items-center content-center justify-center w-full mb-4"> |
12 | | - <CardHeader> |
13 | | - <h4 className="font-open-sans text-small text-default-600">Contact to me.</h4> |
14 | | - </CardHeader> |
15 | | - <CardBody className="px-3 py-0 text-small text-default-400"> |
16 | | - <div className="flex flex-col"> |
17 | | - <div className="flex items-center justify-between"> |
18 | | - <Link className="flex items-center space-x-2 text-default-600"> |
19 | | - <FaMapMarkerAlt /> <span>Location</span> |
20 | | - </Link> |
21 | | - <span className="text-default-400">{userData?.location}</span> |
| 11 | + <Skeleton isLoaded={!isLoading} className="w-full h-full"> |
| 12 | + <CardHeader> |
| 13 | + <h4 className="font-open-sans text-small text-default-600">Contact to me.</h4> |
| 14 | + </CardHeader> |
| 15 | + <CardBody className="px-3 py-0 text-small text-default-400"> |
| 16 | + <div className="flex flex-col"> |
| 17 | + <div className="flex items-center justify-between"> |
| 18 | + <Link className="flex items-center space-x-2 text-default-600"> |
| 19 | + <FaMapMarkerAlt /> <span>Location</span> |
| 20 | + </Link> |
| 21 | + <span className="text-default-400">{userData?.location}</span> |
| 22 | + </div> |
| 23 | + <div className="flex items-center justify-between"> |
| 24 | + <Link |
| 25 | + showAnchorIcon |
| 26 | + href="https://maddonsmanager.github.io/" |
| 27 | + isExternal |
| 28 | + className="flex items-center space-x-2 text-default-600 hover:text-blue-600" |
| 29 | + > |
| 30 | + <BsBuildings /> <span>Company</span> |
| 31 | + </Link> |
| 32 | + <span className="text-default-400">{userData?.company}</span> |
| 33 | + </div> |
| 34 | + <div className="flex items-center justify-between"> |
| 35 | + <Link |
| 36 | + showAnchorIcon |
| 37 | + href="https://x.com/__J3ff_" |
| 38 | + isExternal |
| 39 | + className="flex items-center space-x-2 text-default-600 hover:text-blue-600" |
| 40 | + > |
| 41 | + <BsTwitterX /> <span>Xtwitter</span> |
| 42 | + </Link> |
| 43 | + <span className="text-default-400">{userData?.twitter_username}</span> |
| 44 | + </div> |
| 45 | + <div className="flex items-center justify-between"> |
| 46 | + <Link |
| 47 | + href={userData?.html_url} |
| 48 | + isExternal |
| 49 | + showAnchorIcon |
| 50 | + className="flex items-center space-x-2 text-default-600 hover:text-blue-600" |
| 51 | + > |
| 52 | + <FaGithub /> <span>GitHub</span> |
| 53 | + </Link> |
| 54 | + <span className="text-default-400">{userData?.html_url}</span> |
| 55 | + </div> |
| 56 | + <div className="flex items-center justify-between"> |
| 57 | + <Link |
| 58 | + href="mailto:pentsec.2@protonmail.com" |
| 59 | + className="flex items-center space-x-2 text-default-600 hover:text-blue-600" |
| 60 | + > |
| 61 | + <FaEnvelope /> <span>Email</span> |
| 62 | + </Link> |
| 63 | + <span className="text-default-400">pentsec.2@protonmail.com</span> |
| 64 | + </div> |
22 | 65 | </div> |
23 | | - <div className="flex items-center justify-between"> |
24 | | - <Link |
25 | | - showAnchorIcon |
26 | | - href="https://maddonsmanager.github.io/" |
27 | | - isExternal |
28 | | - className="flex items-center space-x-2 text-default-600 hover:text-blue-600" |
29 | | - > |
30 | | - <BsBuildings /> <span>Company</span> |
31 | | - </Link> |
32 | | - <span className="text-default-400">{userData?.company}</span> |
33 | | - </div> |
34 | | - <div className="flex items-center justify-between"> |
35 | | - <Link |
36 | | - showAnchorIcon |
37 | | - href="https://x.com/__J3ff_" |
38 | | - isExternal |
39 | | - className="flex items-center space-x-2 text-default-600 hover:text-blue-600" |
40 | | - > |
41 | | - <BsTwitterX /> <span>Xtwitter</span> |
42 | | - </Link> |
43 | | - <span className="text-default-400">{userData?.twitter_username}</span> |
44 | | - </div> |
45 | | - <div className="flex items-center justify-between"> |
46 | | - <Link |
47 | | - href={userData?.html_url} |
48 | | - isExternal |
49 | | - showAnchorIcon |
50 | | - className="flex items-center space-x-2 text-default-600 hover:text-blue-600" |
51 | | - > |
52 | | - <FaGithub /> <span>GitHub</span> |
53 | | - </Link> |
54 | | - <span className="text-default-400">{userData?.html_url}</span> |
55 | | - </div> |
56 | | - <div className="flex items-center justify-between"> |
57 | | - <Link |
58 | | - href="mailto:pentsec.2@protonmail.com" |
59 | | - className="flex items-center space-x-2 text-default-600 hover:text-blue-600" |
60 | | - > |
61 | | - <FaEnvelope /> <span>Email</span> |
62 | | - </Link> |
63 | | - <span className="text-default-400">pentsec.2@protonmail.com</span> |
64 | | - </div> |
65 | | - </div> |
66 | | - </CardBody> |
67 | | - <CardFooter></CardFooter> |
| 66 | + </CardBody> |
| 67 | + <CardFooter></CardFooter> |
| 68 | + </Skeleton> |
68 | 69 | </Card> |
69 | 70 | ) |
70 | 71 | } |
0 commit comments