- Made the reorder icon having indicator and move it outside the search box

This commit is contained in:
Shemy Gan committed 2025-01-14 10:38:55 -05:00
1 parent 6f4c606356
commit b5409f0c0f
1 file changed
+19 -11
@@ -1,7 +1,11 @@
import { ServerStartAdornment, ServerEndAdornment } from "../../../../Inputs/TextInput/Adornments"; import {
ServerEndAdornment,
} from "../../../../Inputs/TextInput/Adornments";
import Search from "../../../../Inputs/Search"; import Search from "../../../../Inputs/Search";
import {useState} from "react" import { useState } from "react";
import ReorderRoundedIcon from "@mui/icons-material/ReorderRounded";
import { Stack, IconButton } from "@mui/material";
import React from "react";
/** /**
* *
* @param {*} id The Id of the Server component * @param {*} id The Id of the Server component
@@ -12,30 +16,34 @@ import {useState} from "react"
* @param {*} value the option label of the server/monitor, namely the monitor name field * @param {*} value the option label of the server/monitor, namely the monitor name field
* @returns * @returns
*/ */
const Server = ({ id, removeItem, onChange, monitors, value }) => { const Server = (props) => {
const [search, setSearch] = useState(""); const [search, setSearch] = useState("");
const handleSearch = (val) => { const handleSearch = (val) => {
setSearch(val); setSearch(val);
}; };
return ( return (
<Stack direction={"row"}>
<IconButton>
<ReorderRoundedIcon />
</IconButton>
<Search <Search
id={id} id={props.id}
multiple={false} multiple={false}
isAdorned={false} isAdorned={false}
options={monitors ? monitors : []} options={props.monitors ? props.monitors : []}
filteredBy="name" filteredBy="name"
inputValue={search} inputValue={search}
value={value} value={props.value}
startAdornment={<ServerStartAdornment />}
endAdornment={ endAdornment={
<ServerEndAdornment <ServerEndAdornment
id={id} id={props.id}
removeItem={removeItem} removeItem={props.removeItem}
/> />
} }
handleInputChange={handleSearch} handleInputChange={handleSearch}
handleChange={onChange} handleChange={props.onChange}
/> />
</Stack>
); );
}; };