/** * @license * Copyright 2025 Qwen Team * SPDX-License-Identifier: Apache-2.0 */ import type React from 'react'; export interface CheckboxDisplayProps { checked?: boolean; indeterminate?: boolean; disabled?: boolean; className?: string; style?: React.CSSProperties; title?: string; } /** * Display-only checkbox styled via Tailwind classes. * - Renders a custom-looking checkbox using appearance-none and pseudo-elements. * - Supports indeterminate (middle) state using the DOM property and a data- attribute. * - Intended for read-only display (disabled by default). */ export const CheckboxDisplay: React.FC = ({ checked = false, indeterminate = false, disabled = true, className = '', style, title, }) => { // Render as a span (not ) so we can draw a checkmark with CSS. // Pseudo-elements do not reliably render on in Chromium (VS Code webviews), // which caused the missing icon. This version is font-free and uses borders. const showCheck = !!checked && !indeterminate; const showInProgress = !!indeterminate; return ( {showCheck ? ( ) : null} {showInProgress ? ( * ) : null} ); };