mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 05:46:10 +01:00
refactor(react/dialogs): separate alert component
This commit is contained in:
17
apps/client/src/widgets/react/Alert.tsx
Normal file
17
apps/client/src/widgets/react/Alert.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import { ComponentChildren } from "preact";
|
||||
|
||||
interface AlertProps {
|
||||
type: "info" | "danger";
|
||||
title?: string;
|
||||
children: ComponentChildren;
|
||||
}
|
||||
|
||||
export default function Alert({ title, type, children }: AlertProps) {
|
||||
return (
|
||||
<div className={`alert alert-${type}`}>
|
||||
{title && <h4>{title}</h4>}
|
||||
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user