mirror of
https://github.com/abhijithvijayan/web-extension-starter.git
synced 2026-01-30 09:48:12 +01:00
37 lines
689 B
TypeScript
37 lines
689 B
TypeScript
import * as React from "react";
|
|
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>
|
|
);
|
|
};
|