Processed some UI issues on journal

This commit is contained in:
StormRunner06106
2026-09-12 22:10:44 -07:00
parent 737b56e97e
commit 206bbbc5ed
27 changed files with 1245 additions and 327 deletions
+21
View File
@@ -0,0 +1,21 @@
import { useEffect, useId, useRef } from "react";
import Icon from "./Icon";
export default function Modal({ title, children, onClose, busy = false }) {
const dialog = useRef(null);
const titleId = useId();
useEffect(() => {
const element = dialog.current;
element.showModal();
return () => element.close();
}, []);
return <dialog ref={dialog} className="admin-dialog" aria-labelledby={titleId}
onCancel={(event) => { event.preventDefault(); if (!busy) onClose(); }}>
<div className="admin-dialog__heading">
<h2 id={titleId}>{title}</h2>
<button type="button" className="icon-button" aria-label="Close dialog" disabled={busy} onClick={onClose}><Icon name="close" /></button>
</div>
{children}
</dialog>;
}