import { Autocomplete, Box, FormControl, FormLabel, InputAdornment, MenuItem, Select, Stack, TextField, ToggleButton, ToggleButtonGroup } from "@mui/material"; import { Create, NumberField, useAutocomplete } from "@refinedev/mui"; import { useForm } from "@refinedev/react-hook-form"; import { Controller } from "react-hook-form"; import { IMonitoring } from "./monitorings.types"; import { Group } from "@mui/icons-material"; import { MonitoringStatusEditChip } from "./status/monitoringstatusedit"; import { MonitoringStatusChip } from "./status/monitoringstatuschip"; export const MonitoringCreate = () => { const { saveButtonProps, refineCore: { formLoading }, setValue, register, control, formState: { errors }, } = useForm({}); // const { autocompleteProps: categoryAutocompleteProps } = useAutocomplete({ // resource: "categories", // }); return ( hz }} /> s }} /> s }} /> ( { setValue("status", newValue, { shouldValidate: true, }); return newValue; }} > {"Started"} {"Stopped"} {"Deactivated"} )} /> ); }; //----------- new // ( // { // field.onChange(value); // }} // getOptionLabel={(item) => { // return ( // categoryAutocompleteProps?.options?.find( // (p) => // p?.id?.toString() === // item?.id?.toString(), // )?.title ?? "" // ); // }} // isOptionEqualToValue={(option, value) => // value === undefined || // option?.id?.toString() === value?.id?.toString() // } // renderInput={(params) => ( // // )} // /> // )} // /> //--------------- // } // /> // { // return ( // // ); // }} // /> // ( // { // field.onChange(value.id); // }} // getOptionLabel={(item) => { // return ( // categoryAutocompleteProps?.options?.find((p) => { // const itemId = // typeof item === "object" // ? item?.id?.toString() // : item?.toString(); // const pId = p?.id?.toString(); // return itemId === pId; // })?.title ?? "" // ); // }} // isOptionEqualToValue={(option, value) => { // const optionId = option?.id?.toString(); // const valueId = // typeof value === "object" // ? value?.id?.toString() // : value?.toString(); // return value === undefined || optionId === valueId; // }} // renderInput={(params) => ( // // )} // /> // )} // />