mirror of
https://github.com/grafana/grafana.git
synced 2024-12-01 21:19:28 -06:00
6f02b51561
* Search: Improving search look and feel * Fixed issue with tag filter beeing cramped and wrapping tags * Minor tag polish * fixed type
31 lines
691 B
TypeScript
31 lines
691 B
TypeScript
import React, { FC, memo } from 'react';
|
|
import { css } from 'emotion';
|
|
import { Checkbox, stylesFactory } from '@grafana/ui';
|
|
|
|
interface Props {
|
|
checked?: boolean;
|
|
onClick: any;
|
|
editable?: boolean;
|
|
}
|
|
|
|
export const SearchCheckbox: FC<Props> = memo(({ onClick, checked = false, editable = false }) => {
|
|
const styles = getStyles();
|
|
|
|
return editable ? (
|
|
<div onClick={onClick} className={styles.wrapper}>
|
|
<Checkbox value={checked} />
|
|
</div>
|
|
) : null;
|
|
});
|
|
|
|
const getStyles = stylesFactory(() => ({
|
|
// Vertically align absolutely positioned checkbox element
|
|
wrapper: css`
|
|
height: 21px;
|
|
margin-right: 12px;
|
|
& > label {
|
|
height: 100%;
|
|
}
|
|
`,
|
|
}));
|