mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
refactor(web/dialog): split interfaces (#68)
* tweak(interface/menu): SetNuiFocusKeepInput Default to allow input; disable with "disableInput = false" during registration. * refactor(web/dialog): Split interfaces for better typing of row options for different input types * fix(web/dialog): Use proper type for onChange event Co-authored-by: Linden <65407488+thelindat@users.noreply.github.com>
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { Box, Checkbox } from "@chakra-ui/react";
|
||||
import { useEffect } from "react";
|
||||
import { Row } from "../../../interfaces/dialog";
|
||||
import { ICheckbox } from "../../../interfaces/dialog";
|
||||
|
||||
interface Props {
|
||||
row: Row;
|
||||
row: ICheckbox;
|
||||
index: number;
|
||||
handleChange: (value: string | boolean, index: number) => void;
|
||||
handleChange: (value: boolean, index: number) => void;
|
||||
}
|
||||
|
||||
const CheckboxField: React.FC<Props> = (props) => {
|
||||
@@ -17,7 +17,7 @@ const CheckboxField: React.FC<Props> = (props) => {
|
||||
<>
|
||||
<Box mb={3} key={`checkbox-${props.index}`}>
|
||||
<Checkbox
|
||||
onChange={(e) => props.handleChange(e.target.checked, props.index)}
|
||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => props.handleChange(e.target.checked, props.index)}
|
||||
defaultChecked={props.row.checked}
|
||||
>
|
||||
{props.row.label}
|
||||
|
||||
Reference in New Issue
Block a user