grafana/public/app/features/search/components/SearchCheckbox.tsx
Alex Khomenko 0fceca5f73
Search: use Card component (#29892)
* Search: Use Card component for search items

* Search: Set min height of search item

* Search: Adjust item height

* Search: Move tags to the right

* Search: Center item content

* Search: Align tags

* Search: Adjust Card spacing

* Search: Adjust dimensions
2021-01-19 13:42:59 +02:00

35 lines
709 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(() => ({
wrapper: css`
height: 21px;
& > label {
height: 100%;
& > input {
position: relative;
}
}
`,
}));
SearchCheckbox.displayName = 'SearchCheckbox';