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, CSSProperties } from "preact";
interface AlertProps {
type: "info" | "danger" | "warning";
title?: string;
children: ComponentChildren;
className?: string;
style?: CSSProperties;
}
export default function Alert({ title, type, children, className, style }: AlertProps) {
return (
<div className={`alert alert-${type} ${className ?? ""}`} style={style}>
{title && <h4>{title}</h4>}
{children}
</div>
);
}