Files
signoz/frontend/src/container/GridCardLayout/GridCard/FullView/TableRender/CustomCheckBox.tsx
Vikrant Gupta 01df53074c fix: [GH-4075]: block action on the view section if the dashboard is locked (#4089)
* fix: [GH-4075]: block action on the view section if the dashboard is locked
2023-11-29 00:02:51 +05:30

42 lines
867 B
TypeScript

import { grey } from '@ant-design/colors';
import { Checkbox, ConfigProvider } from 'antd';
import { CheckboxChangeEvent } from 'antd/es/checkbox';
import { CheckBoxProps } from '../types';
function CustomCheckBox({
data,
index,
graphVisibilityState = [],
checkBoxOnChangeHandler,
disabled = false,
}: CheckBoxProps): JSX.Element {
const onChangeHandler = (e: CheckboxChangeEvent): void => {
checkBoxOnChangeHandler(e, index);
};
const color = data[index]?.stroke?.toString() || grey[0];
const isChecked = graphVisibilityState[index] || false;
return (
<ConfigProvider
theme={{
token: {
colorPrimary: color,
colorBorder: color,
colorBgContainer: color,
},
}}
>
<Checkbox
onChange={onChangeHandler}
checked={isChecked}
disabled={disabled}
/>
</ConfigProvider>
);
}
export default CustomCheckBox;