Skip to content

Commit 699ccb3

Browse files
committed
feat: card component
1 parent fd8a381 commit 699ccb3

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/components/card.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import {StaticImageData} from 'next/dist/shared/lib/get-img-props';
2+
import Image from 'next/image';
3+
import Link from 'next/link';
4+
5+
export function Card({
6+
href,
7+
image,
8+
imageAlt,
9+
title,
10+
description,
11+
className = '',
12+
}: {
13+
description: string;
14+
href: string;
15+
image: string | StaticImageData;
16+
imageAlt: string;
17+
title: string;
18+
className?: string;
19+
}) {
20+
return (
21+
<Link href={href} className={className}>
22+
<div className="flex flex-col md:flex-row shadow dark:bg-[var(--gray-4)] p-6 rounded gap-4 h-full">
23+
<Image src={image} height={64} alt={imageAlt} className="object-contain" />
24+
<div className="flex flex-col justify-center space-y-2">
25+
<h3 className="text-xl font-medium">{title}</h3>
26+
<p>{description}</p>
27+
</div>
28+
</div>
29+
</Link>
30+
);
31+
}

0 commit comments

Comments
 (0)