Added NotificationProvider
This commit is contained in:
33
app/components/notification.tsx
Normal file
33
app/components/notification.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user