diff --git a/client/src/Components/v2/Inputs/Select.tsx b/client/src/Components/v2/Inputs/Select.tsx index fb388b334..cb3e12fcb 100644 --- a/client/src/Components/v2/Inputs/Select.tsx +++ b/client/src/Components/v2/Inputs/Select.tsx @@ -1,6 +1,71 @@ -import Select from "@mui/material/Select"; +import { Typography, Select } from "@mui/material"; +import MenuItem from "@mui/material/MenuItem"; +import { forwardRef } from "react"; import type { SelectProps } from "@mui/material/Select"; - -export const SelectInput: React.FC = ({ ...props }) => { - return { + if (!selected) { + return ( + + {placeholder ?? ""} + + ); + } + const selectedItem = items.find((item) => item._id === selected); + const displayName = selectedItem ? selectedItem.name : placeholder; + return ( + + {displayName} + + ); + }} + {...props} + > + {items.map((item) => ( + + {item.name} + + ))} + + ); + } +); +SelectInput.displayName = "SelectInput";