MCPcopy Create free account
hub / github.com/developmentseed/stac-react / ItemList

Function ItemList

example/src/pages/Main/ItemList.jsx:22–51  ·  view source on GitHub ↗
({ items, isLoading, error, nextPage, previousPage, onSelect })

Source from the content-addressed store, hash-verified

20};
21
22function ItemList({ items, isLoading, error, nextPage, previousPage, onSelect }) {
23 return (
24 <Panel className="grid grid-rows-[1fr_min-content] p-4">
25 <div className="overflow-x-clip">
26 <H2>Item List</H2>
27 {isLoading && <p>Loading...</p>}
28 {error && <p>{error}</p>}
29 {items && (
30 <ul className="space-y-2">
31 {items.features.map((item) => (
32 <li key={item.id}>
33 <button onClick={onSelect(item)} className="text-pretty">
34 {item.id}
35 </button>
36 </li>
37 ))}
38 </ul>
39 )}
40 </div>
41 <div className="grid grid-cols-2 gap-4">
42 <PaginationButton disabled={!previousPage} onClick={previousPage}>
43 Previous page
44 </PaginationButton>
45 <PaginationButton disabled={!nextPage} onClick={nextPage}>
46 Next page
47 </PaginationButton>
48 </div>
49 </Panel>
50 );
51}
52
53ItemList.propTypes = {
54 items: TItemList,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected