ConceptPortal-public/rsconcept/frontend/src/components/Common/Card.tsx

17 lines
396 B
TypeScript
Raw Normal View History

2023-07-15 17:46:19 +03:00
interface CardProps {
title?: string
widthClass?: string
children: React.ReactNode
}
2023-07-25 20:27:29 +03:00
function Card({ title, widthClass = 'min-w-fit', children }: CardProps) {
2023-07-15 17:46:19 +03:00
return (
<div className={`border shadow-md py-2 clr-app px-6 ${widthClass}`}>
{ title && <h1 className='mb-2 text-xl font-bold whitespace-nowrap'>{title}</h1> }
2023-07-15 17:46:19 +03:00
{children}
</div>
);
}
2023-07-25 20:27:29 +03:00
export default Card;