import { GetServerSideProps, NextPage } from "next"; import { FaExternalLinkAlt } from "react-icons/fa"; import ReactMarkdown from "react-markdown"; import { Card } from "../../common/Card"; import { Layout } from "../../common/Layout"; import { LineHeader } from "../../common/LineHeader"; import { Query } from "../../common/Query"; import { QuestionWithHistoryFragment } from "../../fragments.generated"; import { ssrUrql } from "../../urql"; import { CaptureQuestion } from "../components/CaptureQuestion"; import { HistoryChart } from "../components/HistoryChart"; import { IndicatorsTable } from "../components/IndicatorsTable"; import { Stars } from "../components/Stars"; import { QuestionPageDocument } from "../queries.generated"; interface Props { id: string; } export const getServerSideProps: GetServerSideProps = async ( context ) => { const [ssrCache, client] = ssrUrql(); const id = context.query.id as string; const question = (await client.query(QuestionPageDocument, { id }).toPromise()).data ?.result || null; if (!question) { context.res.statusCode = 404; } return { props: { urqlState: ssrCache.extractData(), id, }, }; }; const Section: React.FC<{ title: string }> = ({ title, children }) => (

{title}

{children}
); const LargeQuestionCard: React.FC<{ question: QuestionWithHistoryFragment; }> = ({ question }) => (

{question.title}{" "}

{question.platform.label}
{question.platform.id === "guesstimate" && question.visualization ? ( Guesstimate Screenshot ) : ( )}
{question.description.replaceAll("---", "")}
); const QuestionScreen: React.FC<{ question: QuestionWithHistoryFragment }> = ({ question, }) => (

Capture

); const QuestionPage: NextPage = ({ id }) => { return (
{({ data }) => }
); }; export default QuestionPage;