mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
rename DialogProps
This commit is contained in:
@@ -29,7 +29,7 @@ import { validate } from 'validators';
|
|||||||
import { DeviceValueUOM, DeviceValueUOM_s } from './types';
|
import { DeviceValueUOM, DeviceValueUOM_s } from './types';
|
||||||
import type { DeviceValue } from './types';
|
import type { DeviceValue } from './types';
|
||||||
|
|
||||||
interface DashboardDevicesDialogProps {
|
interface DevicesDialogProps {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
onSave: (as: DeviceValue) => void;
|
onSave: (as: DeviceValue) => void;
|
||||||
@@ -47,7 +47,7 @@ const DevicesDialog = ({
|
|||||||
writeable,
|
writeable,
|
||||||
validator,
|
validator,
|
||||||
progress
|
progress
|
||||||
}: DashboardDevicesDialogProps) => {
|
}: DevicesDialogProps) => {
|
||||||
const { LL } = useI18nContext();
|
const { LL } = useI18nContext();
|
||||||
const [editItem, setEditItem] = useState<DeviceValue>(selectedItem);
|
const [editItem, setEditItem] = useState<DeviceValue>(selectedItem);
|
||||||
const [fieldErrors, setFieldErrors] = useState<ValidateFieldsError>();
|
const [fieldErrors, setFieldErrors] = useState<ValidateFieldsError>();
|
||||||
@@ -75,7 +75,10 @@ const DevicesDialog = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const setUom = (uom: DeviceValueUOM) => {
|
const setUom = (uom?: DeviceValueUOM) => {
|
||||||
|
if (uom === undefined) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
switch (uom) {
|
switch (uom) {
|
||||||
case DeviceValueUOM.HOURS:
|
case DeviceValueUOM.HOURS:
|
||||||
return LL.HOURS();
|
return LL.HOURS();
|
||||||
|
|||||||
Reference in New Issue
Block a user