import React from "react" export interface CheckAnswerComponentProps { value?: boolean onValueChange: any /** Label shown next to the checkbox */ children?: React.ReactNode } // This one is very different from the other AnswerComponents since it's displayed before the title (passed has children) export default class CheckAnswerComponent extends React.Component { static defaultProps = { value: false } checkbox: HTMLElement | null = null focus() { return this.checkbox?.focus() } handleValueChange = () => { return this.props.onValueChange(!this.props.value) } render() { return
{ this.checkbox = c }} style={{ display: "flex", alignItems: "center", gap: "10px" }}> {this.props.value ? ( ) : ( )} {" "} {this.props.children}
} }