grafana/public/app/features/search/components/SearchCheckbox.tsx
Tobias Skarhed 7b4a222fbf
Search: Move checkbox outside of item card (#65540)
* Move checkbox outside of SeachItem

* Add li element
2023-03-31 08:49:03 +02:00

22 lines
571 B
TypeScript

import React, { memo } from 'react';
import { Checkbox } from '@grafana/ui';
interface Props {
checked?: boolean;
onClick?: React.MouseEventHandler<HTMLInputElement>;
className?: string;
editable?: boolean;
'aria-label'?: string;
}
export const SearchCheckbox = memo(
({ onClick, className, checked = false, editable = false, 'aria-label': ariaLabel }: Props) => {
return editable ? (
<Checkbox onClick={onClick} className={className} value={checked} aria-label={ariaLabel} />
) : null;
}
);
SearchCheckbox.displayName = 'SearchCheckbox';