Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const ProposalsContainer = (props: { daoAvatarAddress: string }) => {
return {
(state: IObservableState): any => {
if (state.isLoading) {
return <div>loading proposals</div>
} else if (state.error) {
throw state.error
} else {
if (state.data.length == 0) {
return <div> no proposals found</div>
}
return <div>
<span>found {state.data.length} proposals: </span>
{ state.data.map((proposal: IProposalState) => {
return <div>
id: { proposal.id }
</div>
})}</div>
export default (props: RouteComponentProps) => {
const daoAddress = props.match.params.daoAvatarAddress
if (daoAddress) {
return {(state: IObservableState) => {
if (state.error) {
return <div>{ state.error.message }</div>
} else if (state.data) {
return
} else {
return <div>Loading DebugContainer</div>
}
}
}
} else {
throw Error(`no address! `)
}
}