Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
import { ComponentChildren } from "preact";
import Button from "./Button.js";
interface SectionProps {
id?: string;
title?: string;
subtitle?: string;
cta?: { text: string; href: string };
children: ComponentChildren;
className?: string;
}
export default function Section({ id, className, title, subtitle, cta, children }: SectionProps) {
return (
<section id={id} className={className}>
<div className="content-wrapper">
{title && <h2>{title}</h2>}
{subtitle && <p className="section-subtitle">{subtitle}</p>}
{children}
{cta && (
<div className="section-cta">
<Button outline text={cta.text} href={cta.href} openExternally />
</div>
)}
</div>
</section>
)
}