36 lines
850 B
Text
36 lines
850 B
Text
|
export * as layout from "../layout.tsx";
|
||
|
|
||
|
export interface Input {
|
||
|
admin?: boolean;
|
||
|
}
|
||
|
|
||
|
export const meta: Metadata = {
|
||
|
title: "paper clover q+a",
|
||
|
description: "ask clover a question",
|
||
|
};
|
||
|
|
||
|
<const/{ admin = false } = input />
|
||
|
<const/questions = [...Question.getAll()] />
|
||
|
|
||
|
<form action="/q+a" method="POST">
|
||
|
<textarea
|
||
|
name="text"
|
||
|
placeholder="ask clover a question..."
|
||
|
required
|
||
|
minlength="1"
|
||
|
maxlength="10000"
|
||
|
/>
|
||
|
<div aria-hidden class="title">ask a question</div>
|
||
|
<button type="submit">send</button>
|
||
|
<div class="disabled-button">send</div>
|
||
|
</form>
|
||
|
<for|q| of=questions>
|
||
|
<QuestionRender question=q admin=admin />;
|
||
|
</>
|
||
|
<footer>
|
||
|
fun fact: clover has answered ${questions.length} questions
|
||
|
</footer>
|
||
|
|
||
|
import { Question } from "@/q+a/models/Question.ts";
|
||
|
import QuestionRender from '@/q+a/components/Question.marko';
|