22 lines
584 B
TypeScript
22 lines
584 B
TypeScript
import { ReactNode, ComponentPropsWithoutRef } from "react";
|
|
|
|
interface CardProps extends ComponentPropsWithoutRef<"section"> {
|
|
title: string;
|
|
children: ReactNode;
|
|
}
|
|
|
|
export default function Card({ title, children, className = "", ...props }: CardProps) {
|
|
return (
|
|
<section
|
|
className={`p-5 flex flex-col justify-between ${className}`}
|
|
{...props}
|
|
>
|
|
<h2 className="text-lg font-semibold mb-4 flex items-center gap-2">
|
|
{title}
|
|
</h2>
|
|
<div className="flex-1 min-h-0 flex flex-col">
|
|
{children}
|
|
</div>
|
|
</section>
|
|
);
|
|
} |