import React from "react"; import BaseWidget, { WidgetProps, WidgetState } from "./BaseWidget"; import { WidgetType } from "../constants/WidgetConstants"; import CheckboxComponent from "../components/blueprint/CheckboxComponent"; import { ActionPayload } from "../constants/ActionConstants"; class CheckboxWidget extends BaseWidget { getPageView() { return ( ); } onCheckChange = (isChecked: boolean) => { this.context.updateWidgetProperty( this.props.widgetId, "isChecked", isChecked, ); }; getWidgetType(): WidgetType { return "CHECKBOX_WIDGET"; } } export interface CheckboxWidgetProps extends WidgetProps { label: string; defaultCheckedState: boolean; isChecked?: boolean; isDisabled?: boolean; onCheckChange?: ActionPayload[]; } export default CheckboxWidget;