Added the disable style in the ConfigurationRow.jsx

This commit is contained in:
2023-08-13 18:06:49 +02:00
parent af11f34a22
commit 985cf70fad

View File

@ -2,7 +2,7 @@ import "./styles.sass";
import {faSquareRootVariable} from "@fortawesome/free-solid-svg-icons";
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
export const ConfigurationRow = ({text, icon = faSquareRootVariable, type = "input", options, value, setValue}) => {
export const ConfigurationRow = ({text, icon = faSquareRootVariable, type = "input", options, value, setValue, disabled}) => {
return (
<div className="configuration-row">
<div className="left-area">
@ -10,7 +10,8 @@ export const ConfigurationRow = ({text, icon = faSquareRootVariable, type = "inp
<p>{text}</p>
</div>
{type === "select" && <select className="input-field" value={value} onChange={(e) => setValue(e.target.value)}>
{type === "select" && <select className="input-field" value={value} onChange={(e) => setValue(e.target.value)}
disabled={disabled}>
{options.map((option) =>
option.value ? <option value={option.value} key={option.value}>{option.text}</option>
: <option key={option}>{option}</option>
@ -18,7 +19,7 @@ export const ConfigurationRow = ({text, icon = faSquareRootVariable, type = "inp
</select>}
{type === "input" && <input className="input-field" type="text" placeholder={text} value={value}
onChange={(e) => setValue(e.target.value)} />}
onChange={(e) => setValue(e.target.value)} disabled={disabled}/>}
</div>
);
}