Files
Trilium/apps/website/src/components/Card.tsx

22 lines
521 B
TypeScript
Raw Normal View History

2025-09-26 23:06:57 +03:00
import { ComponentChildren } from "preact";
interface CardProps {
title: string;
2025-09-26 23:16:06 +03:00
imageUrl?: string;
2025-09-27 00:46:51 +03:00
className?: string;
2025-09-26 23:06:57 +03:00
children: ComponentChildren;
}
2025-09-27 00:46:51 +03:00
export default function Card({ title, children, imageUrl, className }: CardProps) {
2025-09-26 23:06:57 +03:00
return (
2025-09-27 00:46:51 +03:00
<div className={`card ${className}`}>
2025-09-26 23:16:06 +03:00
{imageUrl && <img class="image" src={imageUrl} />}
<div className="card-content">
<h3>{title}</h3>
2025-09-26 23:06:57 +03:00
{children}
</div>
2025-09-26 23:06:57 +03:00
</div>
)
}