@notebook-intelligence/notebook-intelligence
Version:
AI coding assistant for JupyterLab
17 lines (16 loc) • 1.13 kB
JavaScript
// Copyright (c) Mehmet Bektas <mbektasgh@outlook.com>
import React from 'react';
import { MdOutlineCheckBoxOutlineBlank, MdCheckBox } from 'react-icons/md';
export function CheckBoxItem(props) {
const indent = props.indent || 0;
const disabled = props.disabled || false;
return (React.createElement("div", { className: `checkbox-item checkbox-item-indent-${indent} ${props.header ? 'checkbox-item-header' : ''}`, title: props.tooltip || props.title || '', onClick: event => {
if (!disabled) {
props.onClick(event);
}
} },
React.createElement("div", { className: "checkbox-item-toggle" },
props.checked ? (React.createElement(MdCheckBox, { className: "checkbox-icon", style: { opacity: disabled ? 0.5 : 1 } })) : (React.createElement(MdOutlineCheckBoxOutlineBlank, { className: "checkbox-icon", style: { opacity: disabled ? 0.5 : 1 } })),
React.createElement("span", { style: { opacity: disabled ? 0.5 : 1 } }, props.label)),
props.title && (React.createElement("div", { className: "checkbox-item-description" }, props.title))));
}