-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquests.tsx
61 lines (54 loc) · 1.94 KB
/
quests.tsx
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
import Image from "next/image"
import { Button } from "./ui/button"
import Link from "next/link"
import { quests } from "@/constants"
import { Progress } from "./ui/progress"
type Props = {
points: number
}
export const Quests = ({ points }: Props) => {
return (
<div className="border-2 rounded-xl p-4 space-y-4">
<div className="flex items-center justify-between w-full space-y-2">
<h3 className="font-bold text-lg">
Quests
</h3>
<Link href={"/quests"}>
<Button
size={"sm"}
variant={"primaryOutline"}
>
View all
</Button>
</Link>
</div>
<ul className="w-full space-y-4">
{quests.map((quest) => {
const progress = (points / quest.value) * 100
return (
<div
className="flex items-center w-full pb-4 gap-x-3"
key={quest.title}
>
<Image
src={"/points.svg"}
alt="points"
width={40}
height={40}
/>
<div className="flex flex-col gap-y-2 w-full">
<p className="text-neutral-700 text-sm font-bold">
{quest.title}
</p>
<Progress
value={progress}
className="h-2"
/>
</div>
</div>
)
})}
</ul>
</div>
)
}