Main #21
+6
-3
@@ -3,18 +3,21 @@ import { ReactNode, ComponentPropsWithoutRef } from "react";
|
||||
interface CardProps extends ComponentPropsWithoutRef<"section"> {
|
||||
title: string;
|
||||
children: ReactNode;
|
||||
hasLeftBorder?: boolean;
|
||||
}
|
||||
|
||||
export default function Card({ title, children, className = "", ...props }: CardProps) {
|
||||
export default function Card({ title, hasLeftBorder = false, children, className = "", ...props }: CardProps) {
|
||||
return (
|
||||
<section
|
||||
className={`p-5 flex flex-col justify-between ${className}`}
|
||||
className={`p-5 flex flex-col justify-between ${className} bg-slate-400/30 dark:bg-slate-700/30 rounded-xl`}
|
||||
{...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">
|
||||
|
||||
{/* border-l-2 fügt den Strich links ein, pl-4 macht Platz zum Inhalt */}
|
||||
<div className={`flex-1 min-h-0 flex flex-col border-neutral-200 dark:border-neutral-800 ${hasLeftBorder ? "border-l-2 pl-4}" : ""}`}>
|
||||
{children}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
Reference in new issue
Block a user