59 lines
1.5 KiB
JavaScript
59 lines
1.5 KiB
JavaScript
import { TextField } from "@mui/material";
|
|
import { styleTextSelectRight } from "@/mui";
|
|
|
|
function Field({
|
|
title,
|
|
error,
|
|
placeholder,
|
|
inputProps,
|
|
type,
|
|
dir,
|
|
value,
|
|
updateState,
|
|
}) {
|
|
return (
|
|
<TextField
|
|
label={title}
|
|
error={error}
|
|
dir={dir || "rtl"}
|
|
type={type || "text"}
|
|
value={value}
|
|
onChange={(e) => updateState(e.target.value)}
|
|
className="!w-full !mx-auto !bg-[#FFF]"
|
|
InputProps={inputProps}
|
|
placeholder={placeholder || ""}
|
|
sx={{
|
|
".MuiOutlinedInput-notchedOutline.muirtl-1d3z3hw-MuiOutlinedInput-notchedOutline":
|
|
{
|
|
border: error && "1px solid red !important",
|
|
},
|
|
...styleTextSelectRight,
|
|
// Hide Icon Number
|
|
"& input::-webkit-outer-spin-button, & input::-webkit-inner-spin-button":
|
|
{
|
|
display: "none",
|
|
},
|
|
"& input[type=number]": {
|
|
MozAppearance: "textfield",
|
|
},
|
|
"& .MuiInputBase-input": {
|
|
padding: "12.5px 14px",
|
|
color: "#0009",
|
|
},
|
|
"& .MuiInputBase-root": { borderRadius: "6px !important" },
|
|
"& .MuiOutlinedInput-notchedOutline": {
|
|
border: "1px solid #E9ECEF !important",
|
|
},
|
|
".Mui-focused": {
|
|
"& .MuiOutlinedInput-notchedOutline": {
|
|
border: "1px solid #5559CE !important",
|
|
transition: "0.5s all",
|
|
},
|
|
},
|
|
}}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export default Field;
|