wash-cli 0.19.0

wasmcloud Shell (wash) CLI tool
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import {JSXElementConstructor, ReactElement, ReactNode} from 'react';

// eslint-disable-next-line @typescript-eslint/no-explicit-any -- could be anything for props
interface AppProps<T = any> {
  components: Array<JSXElementConstructor<T>>;
  children: ReactNode;
}

export default function AppProvider(props: AppProps): ReactElement {
  return (
    <>
      {props.components.reduceRight((accumulator, Component) => {
        return <Component>{accumulator}</Component>;
      }, props.children)}
    </>
  );
}