diff --git a/services/web-ui/public/screens-library.jsx b/services/web-ui/public/screens-library.jsx index 9e9f8ec..243ab14 100644 --- a/services/web-ui/public/screens-library.jsx +++ b/services/web-ui/public/screens-library.jsx @@ -1,57 +1,69 @@ -// screens-library.jsx — library / asset grid + asset detail -const { ASSETS: ALL_ASSETS, BINS, COMMENTS, PROJECTS } = window.ZAMPP_DATA; +// screens-library.jsx -function Library({ navigate, onOpenAsset, project = "Protour 2026" }) { - const [bin, setBin] = React.useState("b1"); - const [view, setView] = React.useState("grid"); - const [filter, setFilter] = React.useState("all"); - const [search, setSearch] = React.useState(""); +function Library({ navigate, onOpenAsset, openProject }) { + const { ASSETS: ALL_ASSETS, BINS, PROJECTS } = window.ZAMPP_DATA; + const [view, setView] = React.useState('grid'); + const [filter, setFilter] = React.useState('all'); + const [search, setSearch] = React.useState(''); - let assets = ALL_ASSETS; - if (filter !== "all") assets = assets.filter(a => a.status === filter); + let assets = openProject + ? ALL_ASSETS.filter(a => a.project_id === openProject.id) + : ALL_ASSETS; + if (filter !== 'all') assets = assets.filter(a => a.status === filter); if (search) assets = assets.filter(a => a.name.toLowerCase().includes(search.toLowerCase())); + const displayTitle = openProject ? openProject.name : 'All Assets'; + const errorCount = ALL_ASSETS.filter(a => a.status === 'error').length; + const recentCount = ALL_ASSETS.filter(a => (Date.now() - new Date(a.created_at)) < 86400000).length; + return (