- 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
+34 -26
@@ -1,42 +1,50 @@
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
* @param {*} removeItem The function used to remove a single server * @param {*} removeItem The function used to remove a single server
* @param {*} onChange The Change handler function to handle when the server value is changed * @param {*} onChange The Change handler function to handle when the server value is changed
* used to update the server(monitor) lists * used to update the server(monitor) lists
* @param {*} monitors The server monitors options * @param {*} monitors The server monitors options
* @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 (
<Search <Stack direction={"row"}>
id={id} <IconButton>
multiple={false} <ReorderRoundedIcon />
isAdorned={false} </IconButton>
options={monitors ? monitors : []} <Search
filteredBy="name" id={props.id}
inputValue={search} multiple={false}
value={value} isAdorned={false}
startAdornment={<ServerStartAdornment />} options={props.monitors ? props.monitors : []}
endAdornment={ filteredBy="name"
<ServerEndAdornment inputValue={search}
id={id} value={props.value}
removeItem={removeItem} endAdornment={
/> <ServerEndAdornment
} id={props.id}
handleInputChange={handleSearch} removeItem={props.removeItem}
handleChange={onChange} />
/> }
handleInputChange={handleSearch}
handleChange={props.onChange}
/>
</Stack>
); );
}; };
export default Server; export default Server;