forked from grafana.jool/grafana-jool
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
605 B
22 lines
605 B
import React, { FC, 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: FC<Props> = memo(
|
|
({ onClick, className, checked = false, editable = false, 'aria-label': ariaLabel }) => {
|
|
return editable ? (
|
|
<div onClick={onClick} className={className}>
|
|
<Checkbox value={checked} aria-label={ariaLabel} />
|
|
</div>
|
|
) : null;
|
|
}
|
|
);
|
|
|
|
SearchCheckbox.displayName = 'SearchCheckbox';
|
|
|