Gallery search results
Some pseudo code
const GalleryCard = (title, entryId) => {
return <Paper>
...
{children}
</Paper>
}
const H5WebGalleryCard = (result, archive_path) => {
return <GalleryCard {...}><H5Web path={result.mainfile + archive_path}></H5Web></GalleryCard>
}
const DosGalleryCard = (result) => {
return <GalleryCard {...}><DOS entryId={result.entryId}/></GalleryCard>
}
const galleryComponents = {
'h5web': H5WebGalleryCard,
'dos': DosGalleryCard
}
app = {
search: {
gallery: {
component: 'h5web',
props: {
archive_path: '/nexus/NXmpes/entry/data/data'
}
}
}
<SearchGallery> // a new alternative for SearchResults
const {results, app, callbacks...} = useSearchContext() // ask lauri
const [pinnedResults, setPinnedResults] = useState()
<PinnedGallery>
<MUIGrid>
{pinnedResults.map(...)}
</MUIGrid>
</PinnedGallery>
<MainGallery
<MUIGrid>
{results.map(() => React.createEntry(galleryComponents[app.gallery.component], {result, ...app.gallery.props})}
</MUIGrid>
</MainGallery>
</SearchGallery>