Skip to content

Commit

Permalink
Standardize List Display with Card Component (json-schema-org#433)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-Obele committed Mar 5, 2024
1 parent d8a3505 commit 664ed3f
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions components/Card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React from 'react';
import Link from 'next/link';

interface CardProps {
title: string;
body: string;
icon?: string;
link?: string;
}

const Card: React.FC<CardProps> = ({ title, body, icon, link }) => {
return (
<div className='w-full max-w-md rounded-lg border border-gray-200 bg-white p-6 shadow-3xl'>
<div className='flex flex-row items-center'>
{icon && (
<span className='mb-6 mr-4 flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-lg border bg-blue-200 text-gray-900'>
<img src={icon} alt={title} className='h-full w-full' />
</span>
)}
<h3 className='text-2xl mb-5 pt-5 text-h4 font-bold text-gray-900'>
{title}
</h3>
</div>

<p className='mb-5'>{body}</p>

{link && (
<Link href={link} className='text-sm italic text-gray-500'>
{link}
</Link>
)}
</div>
);
};

export default Card;

0 comments on commit 664ed3f

Please sign in to comment.