chore: add ansible backend docker frontend-prep

This commit is contained in:
2026-01-21 13:05:13 +01:00
parent 5a280b6b01
commit 943fe4de7d
14930 changed files with 2341433 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
import { useEffect, useState } from "react";
import "./Toast.css";
interface ToastProps {
message: string;
type?: "success" | "error" | "warning" | "info";
duration?: number;
onClose?: () => void;
}
export function Toast({
message,
type = "success",
duration = 3000,
onClose,
}: ToastProps) {
const [isVisible, setIsVisible] = useState(true);
useEffect(() => {
const timer = setTimeout(() => {
setIsVisible(false);
onClose?.();
}, duration);
return () => clearTimeout(timer);
}, [duration, onClose]);
if (!isVisible) return null;
const getIcon = () => {
const icons = {
success: "✓",
error: "✕",
warning: "⚠",
info: "",
};
return icons[type];
};
return (
<div className={`toast toast-${type}`}>
<div className="toast-content">
<div className="toast-icon">{getIcon()}</div>
<div className="toast-message">{message}</div>
</div>
<div
className="toast-progress"
style={{ animationDuration: `${duration}ms` }}
/>
</div>
);
}
export default Toast;