integrate TextInput

This commit is contained in:
Alex Holliday committed 2024-11-26 12:21:42 +08:00
1 parent 12767d5dbc
commit 48c3f05831
1 file changed
+9 -4
@@ -11,6 +11,8 @@ import { createToast } from "../../../Utils/toastUtils";
import { logger } from "../../../Utils/Logger"; import { logger } from "../../../Utils/Logger";
import { ConfigBox } from "../styled"; import { ConfigBox } from "../styled";
import Radio from "../../../Components/Inputs/Radio"; import Radio from "../../../Components/Inputs/Radio";
import TextInput from "../../../Components/Inputs/TextInput";
import { HttpAdornment } from "../../../Components/Inputs/TextInput/Adornments";
import Field from "../../../Components/Inputs/Field"; import Field from "../../../Components/Inputs/Field";
import Select from "../../../Components/Inputs/Select"; import Select from "../../../Components/Inputs/Select";
import Checkbox from "../../../Components/Inputs/Checkbox"; import Checkbox from "../../../Components/Inputs/Checkbox";
@@ -249,17 +251,19 @@ const CreateMonitor = () => {
</Typography> </Typography>
</Box> </Box>
<Stack gap={theme.spacing(15)}> <Stack gap={theme.spacing(15)}>
<Field <TextInput
type={monitor.type === "http" ? "url" : "text"} type={monitor.type === "http" ? "url" : "text"}
id="monitor-url" id="monitor-url"
startAdornment={<HttpAdornment https={https} />}
label={monitorTypeMaps[monitor.type].label || "URL to monitor"} label={monitorTypeMaps[monitor.type].label || "URL to monitor"}
https={https} https={https}
placeholder={monitorTypeMaps[monitor.type].placeholder || ""} placeholder={monitorTypeMaps[monitor.type].placeholder || ""}
value={monitor.url} value={monitor.url}
onChange={handleChange} onChange={handleChange}
error={errors["url"]} error={errors["url"] ? true : false}
helperText={errors["url"]}
/> />
<Field <TextInput
type="text" type="text"
id="monitor-name" id="monitor-name"
label="Display name" label="Display name"
@@ -267,7 +271,8 @@ const CreateMonitor = () => {
placeholder={monitorTypeMaps[monitor.type].namePlaceholder || ""} placeholder={monitorTypeMaps[monitor.type].namePlaceholder || ""}
value={monitor.name} value={monitor.name}
onChange={handleChange} onChange={handleChange}
error={errors["name"]} error={errors["name"] ? true : false}
helperText={errors["name"]}
/> />
</Stack> </Stack>
</ConfigBox> </ConfigBox>