feat: replace device location select with input field for direct entry in DetailDevice component
This commit is contained in:
@@ -215,12 +215,6 @@ const DetailDevice = (props) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSelectChange = (value) => {
|
|
||||||
setFormData({
|
|
||||||
...FormData,
|
|
||||||
device_location: value,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const token = localStorage.getItem('token');
|
const token = localStorage.getItem('token');
|
||||||
@@ -366,16 +360,13 @@ const DetailDevice = (props) => {
|
|||||||
<div style={{ marginBottom: 12 }}>
|
<div style={{ marginBottom: 12 }}>
|
||||||
<Text strong>Device Location</Text>
|
<Text strong>Device Location</Text>
|
||||||
<Text style={{ color: 'red' }}> *</Text>
|
<Text style={{ color: 'red' }}> *</Text>
|
||||||
<Select
|
<Input
|
||||||
|
type="text"
|
||||||
|
name="device_location"
|
||||||
value={FormData.device_location}
|
value={FormData.device_location}
|
||||||
onChange={handleSelectChange}
|
onChange={handleInputChange}
|
||||||
disabled={props.readOnly}
|
placeholder="Enter Device Location"
|
||||||
style={{ width: '100%' }}
|
readOnly={props.readOnly}
|
||||||
placeholder="Select Location"
|
|
||||||
options={[
|
|
||||||
{ value: 'Building A', label: 'Building A' },
|
|
||||||
{ value: 'Building B', label: 'Building B' },
|
|
||||||
]}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div style={{ marginBottom: 12 }}>
|
<div style={{ marginBottom: 12 }}>
|
||||||
|
|||||||
Reference in New Issue
Block a user