import * as React from "react"; import { Observable } from "rxjs"; import { CProps, ComponentList, ComponentListProps } from "../runtime"; import { Arc as Protocol, ArcConfig as ProtocolConfig } from "../protocol"; import { ArcToken as Component, TokenEntity as Entity, TokenData as Data } from "./"; import { ITokenQueryOptions as FilterOptions } from "@daostack/client"; interface RequiredProps extends ComponentListProps { } interface InferredProps { arcConfig: ProtocolConfig | undefined; } type Props = RequiredProps & InferredProps; class ArcTokens extends ComponentList { createObservableEntities(): Observable { const { arcConfig, filter } = this.props; if (!arcConfig) { throw Error("Arc Config Missing: Please provide this field as a prop, or use the inference component."); } return Entity.search(arcConfig.connection, filter); } renderComponent(entity: Entity, children: any): React.ComponentElement, any> { const { arcConfig } = this.props; return ( {children} ); } } class Tokens extends React.Component { render() { const { children, sort, filter } = this.props; return ( {(arc: ProtocolConfig) => ( {children} )} ); } } export default Tokens; export { ArcTokens, Tokens };