20 lines
563 B
TypeScript
Raw Normal View History

import React from 'react';
import { PageTitle } from './PageTitle';
import { Page } from './Page';
import { QuestionList } from './QuestionList';
import { getUnansweredQuestions } from './QuestionsData';
export const HomePage = () => (
<Page>
<div>
<PageTitle>Unanswered Questions</PageTitle>
<button>Ask a question</button>{' '}
{/* This button component is passed as children of Page */}
</div>
<QuestionList
data={getUnansweredQuestions()}
renderItem={(question) => <div>{question.title}</div>}
/>
</Page>
);