import { memo, useCallback } from "react"; import { Checkbox, Spinner } from "@blueprintjs/core"; import { CustomClasses } from "../../constants"; import { ZEnrichedCollection } from "Types/transforms"; type OptionProps = { collection: ZEnrichedCollection, isChecked: boolean, onSelect: (value: string) => void }; const CollectionOption = memo(function CollectionOption(props) { const { collection, isChecked, onSelect } = props; const { data: { name }, depth, key } = collection; const handleCheckUncheck = useCallback(() => { onSelect(key); }, [key, onSelect]); return ( ); }); type SelectorProps = { collections: ZEnrichedCollection[], onSelect: (value: string) => void, selectedCollections: string[] }; const CollectionsSelector = memo(function CollectionsSelector(props) { const { collections, onSelect, selectedCollections } = props; return ( collections.length == 0 ? :
{collections.map(coll => )}
); }); export default CollectionsSelector;