import { Checkbox } from '@grafana/ui'; import { t } from 'app/core/internationalization'; import { DashboardTreeHeaderProps, SelectionState } from '../types'; export default function CheckboxHeaderCell({ isSelected, onAllSelectionChange }: DashboardTreeHeaderProps) { const state = isSelected?.('$all') ?? SelectionState.Unselected; return ( { if (state === SelectionState.Mixed) { // Ensure clicking an indeterminate checkbox always clears the selection onAllSelectionChange?.(false); } else { onAllSelectionChange?.(ev.currentTarget.checked); } }} /> ); }