mirror of
https://github.com/abhijithvijayan/web-extension-starter.git
synced 2026-01-30 09:48:12 +01:00
32 lines
638 B
TypeScript
32 lines
638 B
TypeScript
import type {FC, ReactNode} from 'react';
|
|
import styles from './Card.module.scss';
|
|
|
|
interface CardProps {
|
|
title?: string;
|
|
size?: 'default' | 'large';
|
|
children: ReactNode;
|
|
className?: string;
|
|
}
|
|
|
|
export const Card: FC<CardProps> = ({
|
|
title,
|
|
size = 'default',
|
|
children,
|
|
className,
|
|
}) => {
|
|
const classNames = [styles.card, size === 'large' && styles.large, className]
|
|
.filter(Boolean)
|
|
.join(' ');
|
|
|
|
return (
|
|
<div className={classNames}>
|
|
{title && (
|
|
<div className={styles.header}>
|
|
<span className={styles.title}>{title}</span>
|
|
</div>
|
|
)}
|
|
{children}
|
|
</div>
|
|
);
|
|
};
|