Added NotificationProvider

This commit is contained in:
2026-07-25 01:03:16 -04:00
parent d0975354af
commit 2438a07eb7
4 changed files with 246 additions and 140 deletions

View File

@@ -0,0 +1,33 @@
import { Alert, Spinner } from "@heroui/react";
export type NotificationType = {
type: "success" | "default" | "accent" | "danger" | "warning";
loading: boolean;
title: string;
message: string;
};
export function Notification({
type,
loading,
title,
message,
}: NotificationType) {
return (
<div className="flex justify-center fixed top-12 w-dvw z-50">
<Alert className="w-fit h-fit border border-white" status={type}>
{loading ? (
<Alert.Indicator>
<Spinner size="sm" />
</Alert.Indicator>
) : (
<Alert.Indicator />
)}
<Alert.Content>
<Alert.Title>{title}</Alert.Title>
<Alert.Description>{message}</Alert.Description>
</Alert.Content>
</Alert>
</div>
);
}