// Chrome UI: CollectionsDrawer, Toolbar, ShortcutBar
// Pin icon for drawer
function IconPin({ size = 13 }) {
return (
);
}
function CollectionsDrawer({ open, collections, activeCollection, setActiveCollection, files, onClose, onNew, moodboards }) {
const activeMoodboards = (moodboards || []).filter(m => m.pins && m.pins.length > 0);
return (
<>
{open &&
{ if (!active) e.currentTarget.style.background = 'var(--bg-2)'; }}
onMouseLeave={e => { if (!active) e.currentTarget.style.background = 'transparent'; }}
>
{dot ? : icon}
{label}
{count}
);
}
function Toolbar({ filter, setFilter, sort, setSort, search, setSearch, selCount, onDlSel, onDelSel, totalShown, activeTag, setActiveTag, colorFilter, setColorFilter }) {
const [isMobile, setIsMobile] = React.useState(window.innerWidth < 768);
React.useEffect(() => {
const fn = () => setIsMobile(window.innerWidth < 768);
window.addEventListener('resize', fn);
return () => window.removeEventListener('resize', fn);
}, []);
const filters = [
{ id: 'all', label: 'All' },
{ id: 'RAW', label: 'RAW' },
{ id: 'JPG', label: 'JPEG' },
{ id: 'picks', label: '✓ Picks' },
{ id: 'rejected', label: '✕ Rejected' },
{ id: 'rated3', label: '3★+' },
{ id: 'unreviewed', label: 'New' },
];
return (
{/* Filter tabs */}
{filters.map(f => (
))}
{/* Color label filter — hidden on mobile */}
{!isMobile &&
Label
{[null, 'red', 'yellow', 'green', 'blue', 'purple'].map(c => (
setColorFilter(colorFilter === c ? null : c)}/>
))}
}
{/* Sort */}
{/* Search — hidden on mobile */}
{!isMobile &&
setSearch(e.target.value)} placeholder="Search filename, tag…" style={{
width: '100%', height: 28, padding: '0 10px 0 26px',
background: 'var(--bg-2)', border: '1px solid var(--line-1)', borderRadius: 6,
color: 'var(--ink-1)', fontSize: 11.5, outline: 'none',
}}/>
{search && (
)}
}
{/* Active tag pill */}
{activeTag &&
setActiveTag(null)}>#{activeTag}}
{/* Selection actions */}
{selCount > 0 && (
{selCount} selected
} title="Download ZIP">ZIP
} title="Delete selected"/>
)}
{totalShown} shown
);
}
function ShortcutBar() {
const [isMobile, setIsMobile] = React.useState(window.innerWidth < 768);
React.useEffect(() => {
const fn = () => setIsMobile(window.innerWidth < 768);
window.addEventListener('resize', fn);
return () => window.removeEventListener('resize', fn);
}, []);
if (isMobile) return null;
const shortcuts = [
{ k: 'P', l: 'Pick' }, { k: 'X', l: 'Reject' },
{ k: '1–5', l: 'Rate' }, { k: '6–9', l: 'Label' },
{ k: '←→', l: 'Navigate' }, { k: 'Z', l: 'Zoom' }, { k: 'E', l: 'Edit' },
{ k: '\\', l: 'Before/After' }, { k: 'G/L', l: 'View' },
];
return (