import * as React from 'react'; import { connect } from 'react-redux'; import PageController from 'wdk-client/Core/Controllers/PageController'; import { safeHtml, wrappable } from 'wdk-client/Utils/ComponentUtils'; import { Question } from 'wdk-client/Utils/WdkModel'; import { Loading } from 'wdk-client/Components'; import { RootState } from 'wdk-client/Core/State/Types'; class QuestionListController extends PageController<{ questions?: Question[] }> { isRenderDataLoaded() { return this.props.questions != null; } getTitle() { return "Question List"; } renderView() { if (this.props.questions == null) return ; return (

Available Questions

    {this.props.questions.map(question => (
  1. {question.displayName} ({question.urlSegment}) { /* answer page */ }
    Summary:
    {safeHtml(question.summary||'No summary')}
    Description:
    {safeHtml(question.description||'No description')}
  2. ))}
); } } const enhance = connect( (state: RootState) => ({ questions: state.globalData.questions }), () => ({}) ) export default enhance(wrappable(QuestionListController));