import {html} from "lit-element" import {MetalUser} from "../../../types.js" import {renderAuthor} from "./render-author.js" import {QuestionValidation} from "../../types.js" export function renderQuestionEditor({ expand, draftText, validation, handlePostClick, maxCharacterLimit, handleTextAreaChange, author = { userId: "", claims: { admin: false, staff: undefined, banUntil: undefined, banReason: undefined, premiumUntil: undefined, joined: Date.now() - (10 * (1000 * 60 * 60 * 24)), }, profile: { avatar: null, userId: "", tagline: "", nickname: "", }, }, }: { expand: boolean draftText: string maxCharacterLimit: number validation: QuestionValidation handlePostClick: (event: MouseEvent) => void handleTextAreaChange: (event: Event) => void author?: MetalUser }) { const {message, postable, angry} = validation const invalid = !!message return html`
${renderAuthor({ author, likeInfo: undefined, timePosted: Date.now(), handleLikeClick: () => {}, handleUnlikeClick: () => {}, })}
${message ? html`

${message}

` : null}
` }