-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAlgorithmCard.tsx
More file actions
54 lines (48 loc) · 1.53 KB
/
AlgorithmCard.tsx
File metadata and controls
54 lines (48 loc) · 1.53 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
import Link from "next/link";
import type { AlgorithmInfo } from "@/lib/types";
interface AlgorithmCardProps {
algorithm: AlgorithmInfo;
}
export default function AlgorithmCard({ algorithm }: AlgorithmCardProps) {
const { name, key, category, description, difficulty } = algorithm;
return (
<div className="card transition-shadow hover:shadow-lg">
<div className="p-6">
<div className="flex items-start justify-between">
<h3 className="heading-md">{name}</h3>
<Link
className={`badge badge-${difficulty} capitalize`}
href={`/difficulty/${difficulty}`}
>
{difficulty}
</Link>
</div>
<p className="mt-2 line-clamp-2 text-gray-600">{description}</p>
<div className="mt-4 flex items-center justify-between">
<Link className="badge badge-info capitalize" href={`/${category}`}>
{category}
</Link>
<Link
href={`/${category}/${key}`}
className="btn btn-primary flex items-center text-sm"
>
<span>Visualize</span>
<svg
className="ml-1 h-4 w-4"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M14 5l7 7m0 0l-7 7m7-7H3"
/>
</svg>
</Link>
</div>
</div>
</div>
);
}