@@ -3,51 +3,54 @@ import { ArrowRight, MapPin } from "lucide-react";
33import { Badge } from "../ui/badge" ;
44import Link from "next/link" ;
55import { Carousel , CarouselContent , CarouselItem } from "../ui/carousel" ;
6- import { TNetwork , TUserSchema } from "@/types" ;
6+ import { TUserSchema } from "@/types" ;
77import { Avatar , AvatarFallback , AvatarImage } from "../ui/avatar" ;
88import { getIconComponent } from "@/constants" ;
99
10- const ProfileCard = ( {
11- description,
12- location,
13- name,
14- portfolio,
15- skill,
16- profileImage,
17- social,
18- } : TUserSchema ) => {
10+ type User = {
11+ id : number ;
12+ uuid : string | null ;
13+ createdAt : Date ;
14+ updatedAt : Date ;
15+ } ;
16+ type Props = {
17+ profile : TUserSchema & User ;
18+ } ;
19+ const ProfileCard = ( { profile } : Props ) => {
1920 return (
2021 < Card className = "w-full backdrop-blur-3xl shadow flex flex-col dark:bg-zinc-700 border-none transition-all ease-out duration-300" >
2122 { /* header */ }
2223 < CardHeader className = "flex justify-between items-stretch flex-row lg:gap-4 md:gap-2 gap-1 overflow-hidden" >
2324 < Avatar className = "lg:w-24 md:w-20 w-16 lg:h-24 md:h-20 h-16 object-cover transition-all ease-out duration-300" >
2425 < AvatarImage
25- src = { profileImage }
26+ src = { profile . profileImage }
2627 className = "object-fill"
27- alt = " profile photo"
28+ alt = { profile . name }
2829 />
29- < AvatarFallback > { name . substring ( 0 , 2 ) . toUpperCase ( ) } </ AvatarFallback >
30+ < AvatarFallback >
31+ { profile . name . substring ( 0 , 2 ) . toUpperCase ( ) }
32+ </ AvatarFallback >
3033 </ Avatar >
3134 < div className = "flex-start w-full overflow-hidden flex-col lg:gap-1 gap-0.5" >
3235 < h2 className = "lg:text-2xl md:text-xl sm:text-lg text-base font-semibold text-gray-700 dark:text-zinc-200 " >
33- { name }
36+ { profile . name }
3437 </ h2 >
3538 < p className = "flex-center lg:gap-2 md:gap-1 gap-0 lg:text-xl md:text-lg sm:text-base text-xs" >
3639 < MapPin size = { 16 } />
37- { location }
40+ { profile . location }
3841 </ p >
3942 < Carousel className = "w-full lg:mt-1.5 md:mt-0.5 mt-0" >
4043 < CarouselContent
4144 id = "skills"
4245 className = "flex justify-start items-center"
4346 >
44- { skill . map ( ( sk : string , index : number ) => (
45- < CarouselItem key = { index } className = "w-auto basis-[-29-px]" >
47+ { profile . skills . map ( ( skill : string , i : number ) => (
48+ < CarouselItem key = { i } className = "w-auto basis-[-29-px]" >
4649 < Badge
4750 variant = "secondary"
4851 className = "lg:text-sm text-xs cursor-all-scroll select-none"
4952 >
50- { sk }
53+ { skill }
5154 </ Badge >
5255 </ CarouselItem >
5356 ) ) }
@@ -57,7 +60,8 @@ const ProfileCard = ({
5760
5861 < div >
5962 < Link
60- href = { portfolio ?? "https://github.com/devlopersabbir" }
63+ href = { profile . portfolio ?? "https://github.com/devlopersabbir" }
64+ target = "_blank"
6165 className = "hover:underline text-green-600 flex gap-2 font-semibold"
6266 >
6367 < span className = "lg:text-lg md:text-md sm:text-base text-xs" >
@@ -70,16 +74,16 @@ const ProfileCard = ({
7074
7175 < CardContent >
7276 < p className = "font-thin lg:text-lg md:text-base text-xs" >
73- { description }
77+ { profile . description }
7478 </ p >
7579 < div className = "flex-start mt-3 gap-4" >
76- { social ?. map ( ( net : TNetwork , i : number ) => (
80+ { profile . social ?. map ( ( social , i ) => (
7781 < Link
7882 key = { i }
79- href = { net . link }
83+ href = { social . link }
8084 className = "group scale-100 duration-300 ease-out bg-red-600 hover:bg-transparent rounded-md hover:rounded-full p-1.5 text-white"
8185 >
82- { getIconComponent ( net . network as string ) }
86+ { getIconComponent ( social . network ) }
8387 </ Link >
8488 ) ) }
8589 </ div >
0 commit comments