refactor(react/dialogs): separate alert component

This commit is contained in:
Elian Doran
2025-08-05 18:09:29 +03:00
parent 87d9ea06f3
commit 02b0d1fb5e
2 changed files with 32 additions and 18 deletions

View 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>
);
}