mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 12:37:20 +00:00
fix: when auth is disabled, the users entity doesn't exist
This commit is contained in:
35
app/src/ui/components/display/Alert.tsx
Normal file
35
app/src/ui/components/display/Alert.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { ComponentPropsWithoutRef } from "react";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
export type AlertProps = ComponentPropsWithoutRef<"div"> & {
|
||||
className?: string;
|
||||
visible?: boolean;
|
||||
title?: string;
|
||||
message?: string;
|
||||
};
|
||||
|
||||
const Base: React.FC<AlertProps> = ({ visible = true, title, message, className, ...props }) =>
|
||||
visible ? (
|
||||
<div
|
||||
{...props}
|
||||
className={twMerge("flex flex-row dark:bg-amber-300/20 bg-amber-200 p-4", className)}
|
||||
>
|
||||
<div>
|
||||
{title && <b className="mr-2">{title}:</b>}
|
||||
{message}
|
||||
</div>
|
||||
</div>
|
||||
) : null;
|
||||
|
||||
const Warning: React.FC<AlertProps> = (props) => (
|
||||
<Base {...props} className="dark:bg-amber-300/20 bg-amber-200" />
|
||||
);
|
||||
|
||||
const Exception: React.FC<AlertProps> = (props) => (
|
||||
<Base {...props} className="dark:bg-red-950 bg-red-100" />
|
||||
);
|
||||
|
||||
export const Alert = {
|
||||
Warning,
|
||||
Exception
|
||||
};
|
||||
Reference in New Issue
Block a user