Files
Trilium/apps/client/src/widgets/react/Alert.tsx
2025-08-30 13:59:53 +03:00

20 lines
533 B
TypeScript

import { ComponentChildren } from "preact";
import { CSSProperties } from "preact/compat";
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>
);
}