update api export for executive and fixing closing cycle flow
This commit is contained in:
1 parent
d0d1ae7d24
commit
07d36081ce
23 files changed
+1378
-101
No files matched your search
@@ -124,3 +124,73 @@ export const ConfirmDialog: React.FC<ConfirmDialogProps> = ({
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
type AlertDialogProps = {
|
||||
open: boolean;
|
||||
title: string;
|
||||
message: React.ReactNode;
|
||||
dismissLabel?: string;
|
||||
kind?: 'error' | 'info' | 'success';
|
||||
onDismiss: () => void;
|
||||
};
|
||||
|
||||
const alertIconStyles = {
|
||||
error: 'bg-red-600',
|
||||
info: 'bg-sky-600',
|
||||
success: 'bg-green-600',
|
||||
};
|
||||
|
||||
const alertIconClass = {
|
||||
error: 'fa-triangle-exclamation',
|
||||
info: 'fa-circle-info',
|
||||
success: 'fa-circle-check',
|
||||
};
|
||||
|
||||
export const AlertDialog: React.FC<AlertDialogProps> = ({
|
||||
open,
|
||||
title,
|
||||
message,
|
||||
dismissLabel = 'Tutup',
|
||||
kind = 'error',
|
||||
onDismiss,
|
||||
}) => {
|
||||
if (!open) return null;
|
||||
|
||||
return (
|
||||
<div
|
||||
className="fixed inset-0 z-50 flex items-center justify-center bg-slate-900/50 p-4"
|
||||
role="alertdialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby="alert-dialog-title"
|
||||
onClick={onDismiss}
|
||||
>
|
||||
<div
|
||||
className="w-full max-w-md rounded-xl bg-white p-5 shadow-xl"
|
||||
onClick={(event) => event.stopPropagation()}
|
||||
>
|
||||
<div className="mb-4 flex items-start gap-3">
|
||||
<div
|
||||
className={`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg text-white ${alertIconStyles[kind]}`}
|
||||
>
|
||||
<i className={`fa-solid ${alertIconClass[kind]}`} aria-hidden />
|
||||
</div>
|
||||
<div className="min-w-0 pt-0.5">
|
||||
<h3 id="alert-dialog-title" className="text-lg font-semibold text-gray-800">
|
||||
{title}
|
||||
</h3>
|
||||
<div className="mt-1 text-sm text-gray-600">{message}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex justify-end">
|
||||
<button
|
||||
type="button"
|
||||
className="rounded-lg bg-red-600 px-4 py-2 text-sm font-semibold text-white hover:bg-red-700"
|
||||
onClick={onDismiss}
|
||||
>
|
||||
{dismissLabel}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user