Redesign the interface around Scan and Library, classify uncatalogued books from similar ones
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
308c0e1ed3
commit
6cec404e21
71 files changed
+8634
-1502
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import { useRef } from 'preact/hooks';
|
||||
import type { ComponentChildren } from 'preact';
|
||||
import { useDialog } from '../dialog.ts';
|
||||
|
||||
/** A side panel on wide windows and a full-width sheet on narrow ones, over a dimmed page. */
|
||||
export function Panel({ title, onClose, children }: { title: string; onClose: () => void; children: ComponentChildren }) {
|
||||
const ref = useRef<HTMLDivElement>(null);
|
||||
useDialog(ref, onClose, true);
|
||||
return (
|
||||
<div class="backdrop" onMouseDown={e => { if (e.target === e.currentTarget) onClose(); }}>
|
||||
<div class="panel" role="dialog" aria-modal="true" aria-label={title} ref={ref} tabIndex={-1}>
|
||||
<div class="panel-head">
|
||||
<h2>{title}</h2>
|
||||
<button type="button" class="btn-icon" onClick={onClose} aria-label="Close" title="Close">×</button>
|
||||
</div>
|
||||
<div class="panel-body">{children}</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user