-
Notifications
You must be signed in to change notification settings - Fork 438
Expand file tree
/
Copy pathProfileSkills.tsx
More file actions
84 lines (80 loc) · 2.33 KB
/
ProfileSkills.tsx
File metadata and controls
84 lines (80 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
'use client';
import { Info, Pencil } from 'lucide-react';
import React, { useState } from 'react';
import { Button } from '../ui/button';
import SheetWrapper from './sheets/SheetWrapper';
import { SHEETS } from '@/lib/constant/profile.constant';
import { SkillsForm } from './forms/SkillsForm';
import ProfileEmptyContainers from './emptycontainers/ProfileEmptyContainers';
const ProfileSkills = ({
isOwner,
skills,
}: {
isOwner: boolean;
skills: string[];
}) => {
const [isSheetOpen, setIsSheetOpen] = useState<boolean>(false);
const handleClose = () => {
setIsSheetOpen(false);
};
const handleOpen = () => {
setIsSheetOpen(true);
};
return (
<>
<div className="flex justify-between items-center">
<h3 className="font-bold text-2xl">Skills</h3>
{isOwner && (
<Button
variant={'outline'}
className="px-3 py-2 rounded-xs text-slate-500 dark:text-slate-400 flex gap-2"
onClick={handleOpen}
>
<Pencil height={16} width={16} /> Update
</Button>
)}
</div>
{skills.length === 0 && (
<ProfileEmptyContainers
isOwner={isOwner}
buttonText="Add your skills"
handleClick={handleOpen}
title={
isOwner ? ' You haven’t added any skills yet' : 'No Skills added.'
}
description={
isOwner
? 'Highlight your skills to stand out to potential employers.'
: ''
}
Icon={Info}
/>
)}
{skills.length !== 0 && (
<div className="rounded-2xl gap-x-2 p-6 dark:bg-slate-900 bg-slate-100 flex flex-wrap">
{skills.map((title) => {
return (
<div
key={title}
className="dark:border-slate-800 border px-3 py-2 rounded-[8px] dark:text-slate-50 border-slate-200"
>
{title}
</div>
);
})}
</div>
)}
{isOwner && (
<SheetWrapper
isOpen={isSheetOpen}
handleClose={handleClose}
title={SHEETS.skills.title}
description={SHEETS.skills.description}
>
<SkillsForm handleClose={handleClose} skills={skills} />
</SheetWrapper>
)}
</>
);
};
export default ProfileSkills;