28 lines
524 B
TypeScript
28 lines
524 B
TypeScript
import { ReactNode } from 'react'
|
|
import clsx from 'clsx'
|
|
|
|
interface CardProps {
|
|
children: ReactNode
|
|
className?: string
|
|
title?: string
|
|
}
|
|
|
|
export function Card({ children, className, title }: CardProps) {
|
|
return (
|
|
<div
|
|
className={clsx(
|
|
'bg-white dark:bg-gray-800 rounded-lg shadow-md p-6',
|
|
className
|
|
)}
|
|
>
|
|
{title && (
|
|
<h3 className="text-xl font-semibold mb-4 text-gray-900 dark:text-white">
|
|
{title}
|
|
</h3>
|
|
)}
|
|
{children}
|
|
</div>
|
|
)
|
|
}
|
|
|