SearchCheckbox.tsx 606 B

1234567891011121314151617181920212223
  1. import React, { FC, memo } from 'react';
  2. import { Checkbox } from '@grafana/ui';
  3. interface Props {
  4. checked?: boolean;
  5. onClick?: React.MouseEventHandler<HTMLInputElement>;
  6. className?: string;
  7. editable?: boolean;
  8. 'aria-label'?: string;
  9. }
  10. export const SearchCheckbox: FC<Props> = memo(
  11. ({ onClick, className, checked = false, editable = false, 'aria-label': ariaLabel }) => {
  12. return editable ? (
  13. <div onClick={onClick} className={className}>
  14. <Checkbox value={checked} aria-label={ariaLabel} />
  15. </div>
  16. ) : null;
  17. }
  18. );
  19. SearchCheckbox.displayName = 'SearchCheckbox';