import type { ArrayShape, Dataset, ScalarShape, Value } from '@h5web/shared'; import type { ReactNode } from 'react'; import { useDatasetValue } from './hooks'; interface Props { dataset: D; selection?: string; // for slice-by-slice fetching render: (val: Value) => ReactNode; } function ValueFetcher>( props: Props ) { const { dataset, selection, render } = props; const value = useDatasetValue(dataset, selection); return <>{render(value)}; } export default ValueFetcher;