mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 15:36:02 +01:00
25 lines
552 B
TypeScript
25 lines
552 B
TypeScript
|
|
import { Box, Checkbox } from "@chakra-ui/react";
|
||
|
|
import { Row } from "../../../interfaces/dialog";
|
||
|
|
|
||
|
|
interface Props {
|
||
|
|
row: Row;
|
||
|
|
index: number;
|
||
|
|
handleChange: (value: string | boolean, index: number) => void;
|
||
|
|
}
|
||
|
|
|
||
|
|
const CheckboxField: React.FC<Props> = (props) => {
|
||
|
|
return (
|
||
|
|
<>
|
||
|
|
<Box mb={3} key={`checkbox-${props.index}`}>
|
||
|
|
<Checkbox
|
||
|
|
onChange={(e) => props.handleChange(e.target.checked, props.index)}
|
||
|
|
>
|
||
|
|
{props.row.label}
|
||
|
|
</Checkbox>
|
||
|
|
</Box>
|
||
|
|
</>
|
||
|
|
);
|
||
|
|
};
|
||
|
|
|
||
|
|
export default CheckboxField;
|